Hello ! This code below should display me all the alert boxes but , unfortunetly it display only 3 ( without the alert inside the $.post function ) and i really don't see a problem in my code .. What is wrong?
JS
var uname = name.val();
alert( uname );
alert('merge1');
$.post('validateuser.php' , {names:uname} , function(data){
alert('merge2');
});
alert('merge3');
PHP
$name = &$_POST['names'];
if($name != ""){
include('config.php');
$username = mysql_query("SELECT username FROM users WHERE username='$name'");
$count = mysql_num_rows($username);
if($count != 0){
echo 0;
}else{
echo 1;
}
}
may the path is wrong .. so , my folder looks like : folder/core/validateuser.php & folder/core/script.js (location of JS script )