Re: Rasmus' 30 second AJAX Tutorial - [was Re: [PHP] AJAX & PHP]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Boget wrote:
>>function sndReq(action) {
>>    http.open('get', 'rpc.php?action='+action);
>>    http.onreadystatechange = handleResponse;
>>    http.send(null);
>>}
> 
> 
> So with AJAX, the data gets sent back to the browser using GET?
> Is there any way you can do it using POST?

The prototype for the http.open method looks like this:

open("method","URL",async,"uname","pswd")

So to do a POST request instead, just use 'post' instead of 'get' in the
first argument.  Then put the url encoded post data in the http.send() call.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux