Jump to content

Archived

This topic is now archived and is closed to further replies.

Tandem

Retrieving form data

Recommended Posts

When i'm retrieving form data, i usually use one of the following:

[code]$blah = $_POST['blah'];[/code]
or
[code]$blah = $_GET['blah'];[/code]

What other ways are there of retrieving form data, and if they work differently at all, how do they work? Just want to expand my knowledge of php a bit.

Share this post


Link to post
Share on other sites
The only other array is $_REQUEST and its just a catch all mix of $_GET and $_POST aswell as the $_COOKIE array.

Share this post


Link to post
Share on other sites
Well aside from just calling the superglobal itself with the appropriate array reference, there is no other way.  You're always going to either use the array reference or load the array reference into a variable to use the pertinent data.  The only thing I might be able to add for your examples is using the $_REQUEST super global but this is bad practice as the $_REQUEST superglobal just holds data that gets posted from both $_GET and $_POST instead of either of them holding different data.

Share this post


Link to post
Share on other sites
Surely this is a case for RTFM :)

I'd never normally suggest it as I enjoy the challenges too much, but the manual's quite good on this subject.

[url=http://uk.php.net/manual/en/language.variables.external.php]Variables from outside PHP[/url]

Regards
Huggie

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.