Bhushan 0 Posted December 11, 2005 Report Share Posted December 11, 2005 HI Group,Could anyone please tell me some differences between GET and POST methods.How do they work when used.Thanks.Bhushan. Quote Link to post Share on other sites
Skemcin 13 Posted December 11, 2005 Report Share Posted December 11, 2005 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 Quote Link to post Share on other sites
mani_ 0 Posted December 11, 2005 Report Share Posted December 11, 2005 GET and POST both are used in forms to submit informations..let suppose you have a form[code]<form action="index.php" method="POST"><input type="text" name=txtUser><input type="submit" value="Submit"></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 :) Quote Link to post Share on other sites
Bhushan 0 Posted December 12, 2005 Author Report Share Posted December 12, 2005 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<{POST_SNAPBACK}> Quote Link to post Share on other sites
smiles 7 Posted December 14, 2005 Report Share Posted December 14, 2005 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 ! Quote Link to post Share on other sites
Kcarson 0 Posted December 14, 2005 Report Share Posted December 14, 2005 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 !<{POST_SNAPBACK}> 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. Quote Link to post Share on other sites
smiles 7 Posted December 15, 2005 Report Share Posted December 15, 2005 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<{POST_SNAPBACK}> 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 " ??? Quote Link to post Share on other sites
Skemcin 13 Posted December 15, 2005 Report Share Posted December 15, 2005 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. Quote Link to post Share on other sites
boen_robot 107 Posted December 15, 2005 Report Share Posted December 15, 2005 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. Quote Link to post Share on other sites
aspnetguy 30 Posted December 15, 2005 Report Share Posted December 15, 2005 Just be very careful when submiting things like credit card numbers and other extremely important data when it is not encrypted. Quote Link to post Share on other sites
smiles 7 Posted December 16, 2005 Report Share Posted December 16, 2005 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! Quote Link to post Share on other sites
FatalError 0 Posted December 20, 2005 Report Share Posted December 20, 2005 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!<{POST_SNAPBACK}> 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. Quote Link to post Share on other sites
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.