GET not SET response
Posted: Tue Jun 19, 2007 3:33 am
Everah you gave me this bit of code to see what the response would be
Code: Select all
<?php
// This checks for querystring vars called DateHeld and UserName. If they are
// present, then the if gets executed. If not, then the $DateHeld and $UserName
// vars are unset/undefined
if( isset($_GET['DateHeld'], $_GET['UserName']) )
{
$DateHelds= $_GET['DateHeld'];
$UserNames= $_GET['UserName'];
}
// If this fires, then your querystring did not pass the DateHeld var
if (empty($DateHelds )) {
echo '$DateHelds is either 0, empty, or not set at all ';
}
// If this fires, then your querystring did not pass the UserName var
if (empty($UserNames )) {
echo '$UserNames is either 0, empty, or not set at all $UserName';
}
// Evaluates as true because $var is set
// THIS CAN STILL EVALUATE TO TRUE IF UserName WAS PASSED
// IN THE QUERYSTRING BECAUSE YOU SET DateHel AND UserName
// AT THE SAME TIME. DateHeld COULD BE NULL, WHICH MEANS $DateHeld
// IS SET, BUT IS STILL EMPTY
if (isset($DateHelds )) {
echo '$DateHeld is set even though it is empty';
}
?>Really not sure how to proceed with the issue now
echo '$DateHelds is either 0, empty, or not set at all ';
echo '$DateHelds is either 0, empty, or not set at all ';
Original posting
viewtopic.php?t=69348