PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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';
}
?>
The response at the moment i'm getting is:
echo '$DateHelds is either 0, empty, or not set at all ';
echo '$DateHelds is either 0, empty, or not set at all ';
Hold on boys and girls, i think i might found the problem.....
The data that is being fed into the script is coming from two disabled textfields, which in my situation does not pass data to the other script....Once i enabled the the textfields the variables where being passed...
But that is another problem, i need that data to be passed, but i dont want the user to edit the textfield?????