473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GET or POST method?

Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

Jan 15 '08 #1
8 2401
Hello,

on 01/15/2008 12:19 AM Kurda Yon said the following:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jan 15 '08 #2
On Tue, 15 Jan 2008 Kurda Yon <ku******@yahoo .comwrote:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
Use GET when your script is getting information to display to the user.
e.g. A product display get for product id=1, you want to GET the information.

Use POST when you are posting information back to the script to be manipulated
in some fashion.
e.g. Submitting a form with an email for subscription to a newsletter. You
want to POST the information to the script to be handled by a database of
some sort.

D.
--
Superman wears Paul O'Connell pyjamas.
Jan 15 '08 #3
Manuel Lemos wrote:
Hello,

on 01/15/2008 12:19 AM Kurda Yon said the following:
>Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.
Incorrect. There is no standard, and different browsers handle things
differently. I've seen people pass 1K in a GET request - although I
definitely do NOT recommend it! :-)

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 15 '08 #4
Kurda Yon wrote:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

Another consideration - GET URLs can be bookmarked. POST URLs cannot.
So, for instance, if you're displaying a restaurant from a list, GET
would be good so the user could bookmark it. But if you're adding data
to a database, you wouldn't want them to add it every time they visit
the page so you'd want to use POST.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 15 '08 #5
Kurda Yon:
I have to decide which form-method I should use (GET or POST).
http://www.w3.org/2001/tag/doc/whenToUseGet.html

--
Jock
Jan 15 '08 #6
Jerry Stuckle wrote:
Manuel Lemos wrote:
>I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.

Incorrect. There is no standard, and different browsers handle things
differently. I've seen people pass 1K in a GET request - although I
definitely do NOT recommend it! :-)
Although browsers, proxies and servers are free to support URLs of any
length, HTTP/1.1 [1] does explicitly mention 255 characters as the length
above which people ought to exercise caution.

____
1. Hypertext Transfer Protocol -- HTTP/1.1
<http://www.ietf.org/rfc/rfc2616.txt>,
R Fielding, J Gettys et al, 1999.
3.2.1: General Syntax.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 15 days, 23:42.]

GPS & Cameras
http://tobyinkster.co.uk/blog/2008/01/14/gps-cameras/
Jan 15 '08 #7
Jerry Stuckle wrote:
Another consideration - GET URLs can be bookmarked. POST URLs cannot.
So, for instance, if you're displaying a restaurant from a list, GET
would be good so the user could bookmark it. But if you're adding data
to a database, you wouldn't want them to add it every time they visit
the page so you'd want to use POST.
And another: Login forms should normally be POSTed, so as not to reveal
the password in the browser's address bar.

One more: for file uploads, you'll need to POST.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 15 days, 23:49.]

GPS & Cameras
http://tobyinkster.co.uk/blog/2008/01/14/gps-cameras/
Jan 15 '08 #8
David Gillen wrote:
On Tue, 15 Jan 2008 Kurda Yon <ku******@yahoo .comwrote:
>Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
Use GET when your script is getting information to display to the user.
e.g. A product display get for product id=1, you want to GET the information.

Use POST when you are posting information back to the script to be manipulated
in some fashion.
e.g. Submitting a form with an email for subscription to a newsletter. You
want to POST the information to the script to be handled by a database of
some sort.

D.
Either method works: a GET method is slightly insecure, in that an
average idiots can fake a URL and maybe get where they shouldn't: Its
harder to do with POST. There you would have to make up a web page form
to submit with POST to the URL you were trying to screw with.

Get is nice because you can use links to get to a GET enabled page..no
need to carate a form or anything.

I tend too use get for simple indexing into a page of data, and POST to
do the real work. Many of my scripts accept both.


Jan 15 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2467
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an array
7
20936
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open the asp page. When I use _blank target there is no problem, either I use GET or POST method. But when I use _search target, only GET method works.
15
3133
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST. When I find is that if I send the value by the GET method, response.write("From QueryString: " & Request.QueryString("usernamefromform") & "<br><br>")
2
1925
by: Asp Help | last post by:
I'm working on a ASP applicatition to create Windows 2000 users. Because I don't want everybody to have access to the site I've changed te security in IIS 5.0 which runs on a windows 2000 Sp4 server: The security on the site is mainly anonymous. The anonymous account has been changed to an account which has the right permissions. The security on one asp page (GetUser.asp) is changed to only "Windows Integrated". A User that access the...
2
3279
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I add the post data to the headers I get an exception that just says "headers". Can anyone please help me here? Thanks.... public string Get(string u, string c) { WebRequest wr = WebRequest.Create(u); wr.Headers.Add(c);
5
17392
by: Tammy | last post by:
Hi, I have an aspx app which needs to post data to a form and read the response. I am confused on whether I should be using the get_url using "POST" method or the post_url using "GET" method. string get_url = "http://scmvs4:9090/gtccinfo/H485W020.HTML"; --url contains a form string post_url = "http://scmvs4:9090/cgi-bin/gticglnk/P485VEGA"; --called by get_Url upon submit
7
4265
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant" value="Merchant Name"> <input type="hidden" name="OrderID" value="Unique OrderID value"> <input type="hidden" name="email" value="Customers email address (OPTIONAL)">
24
2886
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button image below it.
56
7249
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my website. The issue is that I need to gauge whether a user has any items in their basket to decide which page I redirect them too. I could
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5515
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.