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> Link to comment https://forums.phpfreaks.com/topic/45387-simple-question-about-sajax/ Share on other sites More sharing options...
vbnullchar Posted April 4, 2007 Author Share Posted April 4, 2007 resolving.. Link to comment https://forums.phpfreaks.com/topic/45387-simple-question-about-sajax/#findComment-221019 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.