Page 1 of 1

GET not SET response

Posted: Tue Jun 19, 2007 3:33 am
by ghadacr
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';
}
?>
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 ';

Really not sure how to proceed with the issue now

:?: :?:

Original posting

viewtopic.php?t=69348

Posted: Tue Jun 19, 2007 3:50 am
by Gente
Please provide the URL you are using.

Posted: Tue Jun 19, 2007 4:00 am
by ghadacr
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?????

Hmmm

Any suggestions????

Posted: Tue Jun 19, 2007 4:05 am
by ghadacr
Actually solved that my self...

readonly

Code: Select all

<input readonly type="text"

Posted: Tue Jun 19, 2007 6:09 am
by superdezign
You may want to try hidden inputs so they never see it.

Code: Select all

<input type="hidden" value="whatever" />

Posted: Tue Jun 19, 2007 6:21 am
by ghadacr
No, i want the user to see the data, but thanks for the suggestion :)