Ajax Post MethodIs POST data encrypted?
Posted 29 August 2011 - 3:17 PM
What I want to know is: will the POST data (in this case, John) be encrypted as it is sent to submit.php?
I would also like to know: should ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded"); be placed between ajax.open() and ajax.send() if I use the POST method? Another site says to use it.
Posted 29 August 2011 - 7:58 PM
Also, I am assuming that the data is properly encrypted, just like a standard post request, but again, don't quote me on that.
Sorry I couldn't be of more help. I trust someone will provide a real answer soon enough.
Posted 26 October 2011 - 5:00 PM
1. What's the actual problem with using POST to send data from Ajax to PHP script? So far my testing has worked - PHP received the POST data.
2. Should I only use GET with Ajax?
Thank you! These forums have given me a lot of help.
Posted 26 October 2011 - 7:25 PM
There's no reason you can't use POST with Ajax, but the decision on GET vs. POST should be the same as any time you're deciding between the two (i.e., POST is meant to affect changes or actions on the server; GET is intended to retrieve information).
Thanks for the nice words on the forums!
Posted 27 October 2011 - 4:25 PM
ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");//to those who want to use this line of code: remember to replace the variable "ajax" with your variable name
Which will then send the POST data just like a normal HTML form!
Posted 28 October 2011 - 7:50 AM