?
Solved

get and post form method

Posted on 2003-03-20
6
Medium Priority
?
186 Views
Last Modified: 2010-04-09
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
Comment
Question by:narku_narku
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
herongan earned 80 total points
ID: 8179272
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
 
LVL 17

Expert Comment

by:dorward
ID: 8179279
0
 
LVL 1

Expert Comment

by:herongan
ID: 8179283
METHOD=GET vs. METHOD=POST Reference URL:

http://www.pmel.noaa.gov/toga-tao/get-vs-post.html
0
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!

 
LVL 3

Expert Comment

by:Adelphi
ID: 8204324
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8820585
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9015832
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question