Howdy! I’m at a loss after looking at this for almost an hour. I need another pair of eyes or another brain for that matter. This is a simple form to pass parameters to an ajax script to check availability of the user name. I’m getting this
Notice: Undefined index: username
and I can’t figure it out. If someone could point out what I’m overlooking I’d appreciate it.
Here’s the PHP
//get the username
$username = mysql_real_escape_string($_POST['username']);
//mysql query to select field username if it's equal to the username that we check '
$result = mysql_query('SELECT user_name FROM ajax_users WHERE user_name = "'. $username .'"');
echo $username;//for testing
//if number of rows fields is bigger them 0 that means it's NOT available '
//and we send 0 to the ajax request
//else if it's not bigger then 0, then it's available '
//and we send 1 to the ajax request
Thanks. That was the answer I was looking for. You don’t know how many times I’ve been told that it doesn’t matter as long as the user doesn’t see it. And you don’t know how many tutorials I’ve spent hours on that produce these types of errors, notices and warnings. I don’t understand those that write tutorials and either don’t use good coding practices or publish the tutorial without testing their own source. It’s getting so frustrating trying to learn.