jordanwb Posted September 21, 2009 Share Posted September 21, 2009 This is my first time using Ajax seriously, so my fail may be incredibly simple. I have the following JavaScript function: function SendQuoteRequest () { if (CheckForm ()) { var request = GetHxrObject (); if (request) { request.open("POST", "http://99.224.34.94/~jordanwb/quote/quote_request.php", true); request.onreadystatechange = function () { UpdatePage(request); }; request.send(PreparePostData ()); } else { alert ("Your browser does not support AJAX. If you are using a very old browser, please consider upgrading it."); } } } The request goes through, but on the server side there is no POST data. The post data being sent is like so: client_name=Foo&client_email=foo@bar.com&client_info=a&0[type]=1&0[locale]=1&0[width]=5&0[height]=5&0[mount]=1 This is the backend PHP: <?php $file = fopen ("post_info.txt", "w"); fwrite ($file, print_r ($_POST, true)); fclose ($file); ?> The text that is written is simply: Array ( ) You can access the whole thing at http://99.224.34.94/~jordanwb/quote/quote.htm Quote Link to comment Share on other sites More sharing options...
jordanwb Posted September 23, 2009 Author Share Posted September 23, 2009 According to Firebug the POST data is being sent, but it never gets to the PHP. I changed request.send(PreparePostData ()); to simply request.send("foo=bar&bar=foo"); but PHP doesn't get the POST data. It doesn't seem to be a configuration error because a dummy form I made works: http://99.224.34.94/~jordanwb/test 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.