ipwnzphp Posted July 30, 2009 Share Posted July 30, 2009 I am using thjis ajax code but its not posting to my database, the function is being called fine. but its just not posting to the db. function userTyping() { receiveReq.open("POST", 'getChat.php?chat=1&typing=1', true); var param = 'action=typing'; receiveReq.send(param); } here is the php code it is calling // User is typing storage! if($_POST['action'] == 'typing') { $sql = "INSERT INTO simp_live_typing_status (s_id, typing) VALUES (" . db_input($_POST['sid']) . ", '1')"; db_query($sql); } Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 30, 2009 Share Posted July 30, 2009 try this function userTyping() { receiveReq.open("POST", 'getChat.php?chat=1&typing=1', true); receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); param = "action=typing"; receiveReq.send(param); } 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.