check availability of username is not working

[php]

Sign Up
UserName:
Phone:
Email:
Password:
Confirm Password:
[/php] This is the sign up page i have used onclick event [php]<?php mysql_connect('localhost','root',''); mysql_select_db('test'); $user=$_REQUEST['name']; $chk=$_REQUEST['btn']; if($chk=='Check Availibility') { $sql="SELECT * FROM user WHERE name = '".$user."'"; $result=mysql_query($sql); if(mysql_num_rows($result)>0) { echo "username already exist"; } else { echo "You can use this"; } } ?>[/php] This is the url for AJAX functinnality Please help . I m newbie in PHP.

Try to use jQuery for your Ajax requests. Also, try some debugging (echo or write to a log file values of variables received by your php script).

Sponsor our Newsletter | Privacy Policy | Terms of Service