The above explanation is all I could give for the behavior I have been seeing. What I want to happen:
User starts typing in username or email text box then to the right of it says: Not enough characters, invalid, or valid.
What happens:
User starts typing, says not enough characters. User keeps typing, always says not enough characters.
I added a time() function at the end and the time does in fact update, just not the first part where it tells you the important info. It’s called from a javascript function with the “onkeyup” event.
Client-Side:
[code]
My Second Test Site Username:Password:
E-Mail:
Gender: Male Female
Date of Birth:
[/code]
Server-Side:
[php]<?php
$do = $_POST[‘do’];
$q = $_POST[‘q’];
$con = mysql_connect(‘localhost’, ‘root’, ‘g0dRawR17’);
mysql_select_db(‘websites’);
if($do == ‘username’){
$result = mysql_query(“SELECT * FROM site2_users WHERE username = ‘$q’”);
echo mysql_error();
if(mysql_numrows($result) > 0){
echo ‘Username already taken!’;
}else{
//Again, it would be easy to simply this stuff, but as of now, please just ignore it.
echo ‘Username available!’;
}
}else if($do == ‘email’){
$result = mysql_query(“SELECT * FROM site2_users WHERE email = ‘$q’”);
if(mysql_numrows($result) > 0){
echo ‘Email already taken!’;
}else{
echo ‘Email available!’;
}
}
mysql_close($con);
echo ’ ’ . time();
?>[/php]