Hi, I have a page that contains a GET and a POST form. What are the differences between these two.
<FORM ACTION="index.php3" TYPE=POST>
<FORM ACTION="index.php3" TYPE=GET>
Also, I have noticed there's a hidden variable, called SUBMIT, when a POST form gets submitted. Am I right?
What will be the results when no 'TYPE' is defined? Like this one, <FORM ACTION="index.php3">
Thanks for answering my questions...
A couple of things. Technically speaking it should be method not type when differentiating between GET and POST (just so your form actually works when submitting information! :))
You are correct with regards to the hidden variable SUBMIT.
It is highly recommended that you put the 'METHOD="post/get' in. Otherwise the form won't know what to do with it and the form gets 'reset' (and all information is lost!) :(
The difference between POST and GET :
POST : sends the inputted information to the web server as a 'transaction message body'.
GET : sends the inputted information to the web server appended to the URL (like sitepoint.com/cgi-bin/formmail?name=bc&stuff=iloveyoursite&time=1230GMT etc.)
The GET method is deprecated in HTML 4.0, but don't worry about that :D
Hope that clears it up a bit.
So, if a form doesn't contain either POST or GET, will the server see it as a POST or GET?
Also, can I emulate a URL generated by a POST form?
If so, will this URL suffice?
I have appended the SUBMIT to the URL above.
If you don't include a POST or GET, the server will not be able to send the info and you lose all information you inputted in 5 minutes earlier. I just did a bit of reading and I can confirm you must have a POST or GET method specified in the <FORM> tag; otherwise nothing will happen at all (apart from losing the info).
With regards to appending the 'SUBMIT', you can try it but I'm rather doubtful it will work.
if you use GET then you can bookmark the page without any problems.
but with POST you woulnd be able to bookmark the rusult from a sear for example.
at least i think i'm right.
Nowadays, it seems the GET method is used more for URL redirection. If page content is retrieved dynamically from a database, a single page can be used to display multiple records, i.e. mysite.com/index.cfm?pageID=newmembers
Whereas, the post method is used for form submission.