Re: why use $_POST when you have $_SESSION?
- From: "Curtis" <dyer85@xxxxxxxxx>
- Date: 29 Jan 2007 17:10:36 -0800
On Jan 28, 10:51 am, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
Tony Marston wrote:
"Jerry Stuckle" <jstuck...@xxxxxxxxxxxxx> wrote in message
news:wfKdnTa_dtSiNSHYnZ2dnUVZ_vXinZ2d@xxxxxxxxxxxxxx
Tony Marston wrote:
"Paul Lautman" <paul.laut...@xxxxxxxxxxxxxx> wrote in message
news:51v4v1F1k55ftU1@xxxxxxxxxxxxxxxxxxxxx
Tony Marston wrote:
Wrong. $_GET is used to request data FROM the server, while $_POST isYou will always use $_POST when sendingExcept when you use $_GET or $_REQUEST
data from the client to the server,
used to send data TO the server.
No, Tony. $_GET is used to fetch information from the query string. This
can be from several sources - including <form action=get...>. But $_GET
is always used on the server, and the data always comes from the browser.
I disagree. The GET method is used to fetch data from the server and send it
to the client. The POST method is use to send data from the client to the
server. The GET method is bookmark-able, whereas the POST method is not.
This is the correct way as it is not good practice to bookmark a URL which
updates the server.
I know you disagree, Tony. It's just another example of your
stoopidity. Not understanding what's going on.
Even though I know it's hopeless, here's an attempt to educate you.
GET and POST are both methods of requesting data from the server. Both
are sent by the browser to request a page from the server. They include
the URI to be retrieved.
The only difference between them is how they send specific data to the
server. The GET method includes parameters int he URI string. The POST
method sends the data as a separate string, similar to the way cookies
are sent. The only time the browser will send a POST request is in
response to a form with an method=post. However, you can POST to a form
yourself, i.e. by opening a socket and sending a POST request. That's
what CURL does when requested, for instance. Or, you can do it manually
(although I don't recommend it - it gets a bit complex).
Both are bookmarkable. The difference is that when you use a bookmark,
your browser will always do a GET, even if the original request was a
POST. This may or may not be important. For instance, often times a
form submits back to itself for parameter checking. In this case, you
would only have to fill in the data itself. If, however, the form
required data, you would get an error from the form itself.
I know all this is wasted on you, Tony. But maybe someone else will
learn from it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================
Just to add on to what you were saying: the application that receives
the POST request on the server takes in the data through the STDIN
stream. POST requests can accommodate more data. Rik summed up the
purposes for using each pretty nicely. One should not allow records
from a database to altered through a URI, like this, for example:
http://example.com/admin/?delete=some_ID. I used this when I was still
new to PHP and Web programming.
If only I had known about this newsgroup a long time ago, I probably
would've avoided more pitfalls earlier. ;-)
--
Curtis
.
- References:
- why use $_POST when you have $_SESSION?
- From: Sandman
- Re: why use $_POST when you have $_SESSION?
- From: Tony Marston
- Re: why use $_POST when you have $_SESSION?
- From: Paul Lautman
- Re: why use $_POST when you have $_SESSION?
- From: Tony Marston
- Re: why use $_POST when you have $_SESSION?
- From: Jerry Stuckle
- Re: why use $_POST when you have $_SESSION?
- From: Tony Marston
- Re: why use $_POST when you have $_SESSION?
- From: Jerry Stuckle
- why use $_POST when you have $_SESSION?
- Prev by Date: Re: upload file error 3: "The uploaded file was only partially uploaded"
- Next by Date: Re: Username regular expression
- Previous by thread: Re: why use $_POST when you have $_SESSION?
- Next by thread: Re: why use $_POST when you have $_SESSION?
- Index(es):
Relevant Pages
|