vbnullchar Posted April 3, 2007 Share Posted April 3, 2007 hi im learning sajax and i cant get this code to work, can you tell whats wrong <? include('includes/Sajax.php'); include('sources/class.mysql.php'); $mysql = new cMysql(); function _check_username($name) { global $mysql; $sql="select username from employees where username='$name'"; return $mysql->num_rows($sql); } sajax_init(); $sajax_debug_mode = 1; sajax_export("_check_username"); sajax_handle_client_request(); ?> <script> <? sajax_show_javascript(); ?> function do_show_result(result) { document.getElementById("result").value = result; } function do_check_username() { var username; username=document.getElementById("uname").value; x__check_username(username,do_show_result); } </script> <div id="result">aaaa</div> <form method="POST"> <input type="text" id='uname' > <input type="button" value="check" onclick="do_check_username();return false;" > </form> Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted April 4, 2007 Author Share Posted April 4, 2007 resolving.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.