Re: Are $_POST and $_GET interchangable?
| From: | Richard Davey | Date: | Wed, 10 Mar 2004 12:24:26 +0000 |
| Subject: | Re: Are $_POST and $_GET interchangable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180009@lists.php.net to get a copy of this message | ||
Hello DAvid,
Wednesday, March 10, 2004, 11:08:01 AM, you wrote:
DJ> I understand the difference between how they process from data.
DJ> Most application seem to reply on $_GET which display the
DJ> session/from/cookie values in the URL windows.
Just to re-cap where they come from:
It depends on how the data is being sent to your script. For example,
variables passed on the query string - i.e.:
http://www.site.com/file.php?a=hello&b=world
Those variables (a and b) will only be visible via $_GET.
Where-as values passed from a form that uses the POST method:
<form action="file.php" method="post">
</form>
These will only be available in $_POST.
DJ> What I'm not clear on are there times when you have to either $_POST or
DJ> $_GET?
Well that depends on the script in question more than anything. If
you're trying to pass values to a script that is expecting them to be
in $_GET then you have to pass those values on the query string.
What situation do you have that makes you ask this question? Perhaps
with a little more detail we can explain further?
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html