Jump to content

Retrieving form data


Tandem

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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.