[FX.php List] $_REQUEST

Jonathan Schwartz jschwartz at exit445.com
Wed Jul 30 16:00:03 MDT 2008


I assumed that everyone has this challenge. Folks arrive to a given 
page from either a link using a GET or a from using a POST. Let's say 
that we need to edit the page and the recid is the field in question. 
Either the GET or the POST has to contain a recid or it's a no go....

if(isset($_GET['recid']) or isset($_POST[recid])
{
Good
}else{
Bad
}

or, the other way...

if(!isset($_GET['recid']) and !isset($_POST[recid])
{
Bad
}else{
Good
}

Of course, just testing for empty isn't good enough, so this code 
starts to expand. ;-)

Just thought that the $_REQUEST was a simpler approach that I had overlooked.

J


At 4:40 PM -0500 7/30/08, Andrew Denman wrote:
>
>I have not yet had an instance where I'm using both POST and GET so I
>haven't used $_REQUEST and cannot provide first-hand experience.
>detection.
>
>Andrew Denman

-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-370-5011


More information about the FX.php_List mailing list