hi frds i am working on a project in which i need to check the username availability …
for that i am using script from a original poster
but its not working here is the script and php code plz help…
script:
Username availability Checking using jQuery body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; } .top { margin-bottom: 15px; } .messagebox{ position:absolute; width:100px; margin-left:30px; border:1px solid #c93; background:#ffc; padding:3px; } .messageboxok{ position:absolute; width:auto; margin-left:30px; border:1px solid #349534; background:#C9FFCA; padding:3px; font-weight:bold; color:#008000; } .messageboxerror{ position:absolute; width:auto; margin-left:30px; border:1px solid #CC0000; background:#F7CBCA; padding:3px; font-weight:bold; color:#CC0000; }php code:
<?php mysql_connect('localhost','root','****') or die('There is error to connect to server:-'.mysqli_connect_error()); $db_selected = mysql_select_db('dailynotes'); $user_name=$_REQUEST['user_name']; $sql = "select * from userinformation2 where username='$user_name'"; $result = mysql_query($sql); while($row = mysql_fetch_assoc($result)) { $existing_users[] = $row['username']; } if (in_array($user_name, $existing_users)) { //user name is not availble echo "no"; } else { //user name is available echo "yes"; } ?>