So what i would like to achive its a simple suggestion with AJAX, everithing works fine, but it wont read the value of the input with POST... i can verifiy if isset, the index is working... but i cant even _POST the input...
the JQ post method for ajax :
$(document).ready(function(){
$("input").keyup(function(){
var name = $("input").val();
$.post("suggestions.php", {
suggestion: name
}, function(data, status){
$("#test").html(data);
});
});
});
the input name and #test paraghaph are there , and they work
suggestions.php :
$existingNames = array("Daniel","Dennis", "Alex");
if (isset($_POST['suggestion']))
{
$name = $_POST['suggestion'];
//$name = "D" ( if i uncomment this it will show Daniel and Denis)
foreach ($existingNames as $exista) {
if(strpos($exista , $name) !== false){
echo $exista;
echo "<br>";
}
}
}