So basically, I want to add a feature to my registration form which I will check if that username already exists in the database.
I have a few questions about AJAX -
if (mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='".$_POST['username']."'")) < 1) {
true;
} else {
false;
}
you can pass it by get or post methods. in validation.php you just have to write $somevar=$_POST['somevar'];
as I just said you cant pass variables by post or get methods - to do this task, you must us GET.
i hope i was helpful ;)