Jump to content

GET & POST


Bhushan

Recommended Posts

The general rule of thumb is, when in doubt use "post". Get is typically only used for a "search" type application. Since "get" (as defined below) puts information in the URL, it can be bookmarked - which means users can come back to that page without having to input the values into your form again - its a time saver.

The HTTP method for sending data to the action URL. Default is get.method="get": This method sends the form contents in the URL: URL?name=value&name=value. Note: If the form values contains non-ASCII characters or exceeds 100 characters you MUST use method="post".method="post": This method sends the form contents in the body of the request. Note: Most browsers are unable to bookmark post requests.
Cited from:http://www.w3schools.com/tags/tag_form.asp
Link to comment
Share on other sites

GET and POST both are used in forms to submit informations..let suppose you have a form[code]<form action=&#34;index.php&#34; method=&#34;POST&#34;><input type=&#34;text&#34; name=txtUser><input type=&#34;submit&#34; value=&#34;Submit&#34;></form>[/code]Now when you submit the form the address bar will show only the addess of index.php .. all the information (txtUser) will be passed with headers.. but now shown in Browser's address bar..It will as like following[b]http://www......./index.php[/b]But if you use the GET method instead of POST then after submitting you will notice that address bar will show [b]http://www......./index.php?txtUser=[color="blue"]value[/color][/b]where value is that which is wrriten in text box..I hope you have understand the difference now :)
Link to comment
Share on other sites

Hey,Thanks for the information. I have understood it very much.Thnx,Bhushan.

The general rule of thumb is, when in doubt use "post".  Get is typically only used for a "search" type application.  Since "get" (as defined below) puts information in the URL, it can be bookmarked - which means users can come back to that page without having to input the values into your form again - its a time saver.Cited from:http://www.w3schools.com/tags/tag_form.asp

Link to comment
Share on other sites

so , here is an example about " submit " of w3chttp://www.w3schools.com/html/tryit.asp?fi...tml_form_submitand it source :

<html><head><title>Tryit Editor v1.4</title><link rel="stylesheet" type="text/css" href="/tryittheme.css" /></head><body><table cellpadding="0" cellspacing="0" width="100%" bgcolor="#808080"><tr><td width="234" valign="top"><a href="http://www.w3schools.com"><img src="/images/w3default80.gif" border="0" alt="W3Schools" /></a></td><th valign="middle" width="470" class="right"><center><iframe src="/banners/bannerframe.asp?adpartner=netshelter" height="90" width="728"marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe><br /></center></th><td> </td></tr></table><table width="100%" border="0" cellpadding="5" cellspacing="0"><form action="tryit_view.asp" method="post" target="view"><tr><td colspan="2"><input name="submit" type="submit" value="Edit the text and click me"></td></tr><tr><td width="50%"><textarea width="100%" height="400px" style="width:100%;height:400px" name="code" wrap="logical" rows="21" cols="42"><html><body><form name="input" action="html_form_action.asp" method="get">Type your first name: <input type="text" name="FirstName" value="Mickey" size="20"><br>Type your last name: <input type="text" name="LastName" value="Mouse" size="20"><br><input type="submit" value="Submit"></form> <p>If you click the "Submit" button, you will send your input to a new page called html_form_action.asp.</p></body></html></textarea></td><td><iframe width="100%" height="400px" style="width:100%;height:400px;background-color:ffffff" name="view" src="tryit_view.asp?filename=tryhtml_form_submit"></iframe></td></tr><tr><th colspan="2" class="right" align="left">Edit the text above, and click on the button to see the result.</th></tr></form></table></body></html>
I want to ask the source code of ...tryit_view.asp?filename=tryhtml_form_submitwhat 's in it that anything I write in the left page is appeared in the right page ???Thanks !
Link to comment
Share on other sites

so , here is an example about " submit " of w3chttp://www.w3schools.com/html/tryit.asp?fi...tml_form_submitand it source :I want to ask the source code of ...tryit_view.asp?filename=tryhtml_form_submitwhat 's in it that anything I write in the left page is appeared in the right page ???Thanks !

Well, the sourcecode of that page would look something like this:
<body>Welcome<%response.write(request.querystring("fname"))response.write(" " & request.querystring("lname"))%></body>

See the ASP tutorial on w3schools, specifically this page:http://www.w3schools.com/asp/asp_inputforms.aspAs far as how the changes you make on the left hand side effect the right hand side, well that is the purpose of the try-it pages, so that you can play with the code and see the result.

Link to comment
Share on other sites

The general rule of thumb is, when in doubt use "post".  Get is typically only used for a "search" type application.  Since "get" (as defined below) puts information in the URL, it can be bookmarked - which means users can come back to that page without having to input the values into your form again - its a time saver.Cited from:http://www.w3schools.com/tags/tag_form.asp

Well, "post" make anything we send become secret , and just only we know. "get " for everyone know. But sometimes when I login , I see a warning that someone on the Webs maybe see your information , it means I have just " get " ??? :)
Link to comment
Share on other sites

Well, "post" make anything we send become secret , and just only we know.        "get " for everyone know. But sometimes when I login , I see a warning that someone on the Webs maybe see your information , it means I have just " get " ??? :)

Can you restsate your question, I am not quite sure what you mean?Sorry. :)
Link to comment
Share on other sites

Well, "post" make anything we send become secret , and just only we know.        "get " for everyone know. But sometimes when I login , I see a warning that someone on the Webs maybe see your information , it means I have just " get " ??? :)

No. This message means that the data is not encrypted... that is... not encoded. In other words- If the site's administrator decides that he would like to view your data, he can do it. BEWARE! This MAY also includes passwords. Anyway- this doesn't always mean that the admin is a froad. If you trust the site and the admin(s) there's no reason why not to post your data.
Link to comment
Share on other sites

When I login to YahooMail , I " sometimes" see that warning , not " always " , I want to ask why has that warning and why my data is not encoded ? caused by network 's  problems at those time ?  :) Thanks!

Yahoo does that every once in a while if you use the "Remember Me" option. It checks to make sure that you aren't let's say using your friends computer, and he had his password remembered.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...