Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

get and post form method

HY EXPERTS
I WANT TO ASK a question that, what is the difference between "GET" and "POST" form method in html? explain through a example
0
narku_narku
Asked:
narku_narku
1 Solution
 
heronganCommented:
POST:
The FORM collection property contains, and allows you to retrieve, the values of the <FORM> elements posted to a request form using the POST method

-------------------File1.asp------------------------
<HTML>
<HEAD>
</HEAD>
<BODY>
<form action="File2.asp" method="POST">
Name:<input type="Text" name="Name" maxlength="20"><br>
Company:<input type="Text" name="Company" maxlength="20"><br>
Position:<input type="Text" name="Position" maxlength="20"><br>
Address:<textarea name="Address" rows="3"></textarea><br>
Phone:<input type="Text" name="Phone" maxlength="20"><br>
<input type="Submit" name="Submit" value="Submit">
</form>
</BODY>
</HTML>
-------------------File2.asp------------------------
<HTML>
<HEAD>
</HEAD>
<BODY>
<% Response.Write Request.Form("Name")%> works for
<% Response.Write Request.Form("Company") %> at address
<% Response.Write Request.Form("Address") %> as a
<% Response.Write Request.Form("Position") %>.<br>
</BODY>
</HTML>

=======================================================

GET:
The QueryString collection property contains the values of the variables in the HTTP query string, which are the statements that follow a question mark.

-----------------------File1.asp----------------------
<HTML>
<HEAD>
</HEAD>
<BODY>
<A HREF="File2.asp?language=ASP&type=general">Query sample</A>
</BODY>
</HTML>
 
-----------------------File2.asp----------------------
<%
For Each item In Request.QueryString
    Response.Write(item & " = " & Request.QueryString(item) & VbCrLf)
Next
%>
 
=====================================================

GET Method have a limit that it only can submit about 2048KB data.


Hero
0
 
heronganCommented:
METHOD=GET vs. METHOD=POST Reference URL:

http://www.pmel.noaa.gov/toga-tao/get-vs-post.html
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
AdelphiCommented:
The example from herongan is correct, but here are some practical answers as well.

"Get" sends the form information to the server appended to the URL.  Ever notice that when you type in a word to search at some sites, the thing you typed in is part of the URL when it goes to the next page?  That's often the result of using GET. Since it is passed along with the URL, the number of characters is limited.  In addition, it is handled differently by the server (see herongan's querystring example).  

In contrast, search at http://www.amazon.com.  They use post. With a POST, the form results are sent as part of the HTTP header....hidden to the user.  Since the data is sent to the server this way, it is more appropriate for large amounts of data or for data that should not be displayed in the URL.

Make sense?
0
 
COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
COBOLdinosaurCommented:
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to herongan

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now