Thanks for the super-quick suport
If I do it in the action I don`t get any result
I need to have the results from database in input name
Because from the input text (name)
I drop a number to get the limit
Code: Select all
<input type="text" style="" id="fname" class="tftextinput" name="id='. $row1['id']. '&limit1" size="21" placeholder="Search Members..." maxlength="120" />
When I press search I get this result
Code: Select all
http://145.53.93.209/Molendijk/Member/Backup/Backup-Limit.php?id%3D22%26limit1=10
But the result must be like this
Code: Select all
http://145.53.93.209/Molendijk/Member/Backup/Backup-Limit.php?id=4400&limit1=30
Full code under (with select item)
Code: Select all
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<?php
// connect to the "tests" database
$conn = new mysqli('127.0.0.1', 'course_chat', '123456', 'course_chat');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
// SELECT sql query
$sql = "SELECT * FROM `ajax_chat_title` ORDER BY `ajax_chat_title`.`id` DESC LIMIT 3";
// perform the query and store the result
$result = $conn->query($sql);
// if the $result contains at least one row
if ($result->num_rows > 0) {
// output data of each row from $result
while($row = $result->fetch_assoc()) {
echo '
<style type="text/css">
.selectt {
color: #000000;
padding: 3px;
display: none;
margin-top: 30px;
width: 40%;
background: white;
}
label {
margin-right: 20px;
}
</style>
<div>
<label> <img src="http://145.53.93.209/Molendijk/Members/'. $row['id']. '.jpg" border="none" width="40" height="40"></img>
<input type="checkbox" name="colorCheckbox"
value="'. $row['id']. '">'. $row['text']. '</label>
</div>
' ;
}
}
else {
echo 'No-one added yet a @1';
}
$conn->close();
?>
Code: Select all
<div class="venster"><button>Post Selected Members</button>
<?php
// connect to the "tests" database
$conn = new mysqli('127.0.0.1', 'course_chat', '123456', 'course_chat');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
// SELECT sql query
$sql = "SELECT * FROM `ajax_chat_title` ORDER BY `ajax_chat_title`.`id` DESC LIMIT 3";
// perform the query and store the result
$result = $conn->query($sql);
// if the $result contains at least one row
if ($result->num_rows > 0) {
// output data of each row from $result
while($row1 = $result->fetch_assoc()) {
echo '
<div class="'. $row1['id']. ' selectt">
<img src="http://145.53.93.209/Molendijk/Members/'. $row1['id']. '.jpg" border="none" width="40" height="40"></img>
<div class="search-box">
<form id="tfnewsearch" autocomplete="off" method="get" action="http://145.53.93.209/Molendijk/Member/Backup/Backup-Limit.php?id='. $row1['picture_id']. '" target="_top">
<input type="submit" target="offtopic1" value="search" class="tfbutton">
<input type="text" style="" id="fname" class="tftextinput" name="id='. $row1['picture_id']. '&limit1" size="21" placeholder="Search Members..." maxlength="120" />
<br>
<div class="result"></div> </form>
</div>
<br>
<div class="result">
</div>
<strong>'. $row1['text']. '</strong>
</div>
' ;
}
}
else {
echo 'No-one added yet a @1';
}
$conn->close();
?></div>
<script type="text/javascript">
$(document).ready(function() {
$('input[type="checkbox"]').click(function() {
var inputValue = $(this).attr("value");
$("." + inputValue).toggle();
});
});
</script>
<script>
var inputBox = document.getElementById('fname');
inputBox.onkeyup = function(){
document.getElementById('printchatbox').innerHTML = inputBox.value;
}
</script>
I hope I made it understandble