Re: why use $_POST when you have $_SESSION?



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:

You will always use $_POST when sending
data from the client to the server,
Except when you use $_GET or $_REQUEST
Wrong. $_GET is used to request data FROM the server, while $_POST is
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

.



Relevant Pages

  • Re: 6.0.28000.1106 - "Content-Length" of "0" problems
    ... Wininet retries POST requests with a blank header ... password) to a Web server retry the POST request with a blank header if the ... Web server closes the initial connection request. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: HTTP request problem
    ... "Extra CRLF Character Is Added to a POST Request That Is Sent to an HTTP 1.1 ... it thinks that it is communicating with an HTTP 1.0-based server ... ...
    (microsoft.public.win32.programmer.networks)
  • Re: Disable Front Page confirnation
    ... A form, when posted, sends a POST request to the server. ... you can't "disable" the confirmation page. ... > successfully submitting a form to a database? ...
    (microsoft.public.frontpage.programming)
  • Re: IIS6 POST request failing with 500 error
    ... writing an app to simulate the post request, although I can replicate it via ... It seems to be some part of the HTTP request that IIS6 is incredibly ... but now we have changed suppliers and the exact same thing is ...
    (microsoft.public.inetserver.iis)
  • Re: call a routine from Javascript
    ... Since JavaScript runs on the client, and the code-behind on the server, the only way is to have the client send a request. ... but you can also construct a POST request using XmlHttpRequest. ...
    (microsoft.public.dotnet.framework.aspnet)