GET not SET response

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!

Moderator: General Moderators

Post Reply
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

GET not SET response

Post 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
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Please provide the URL you are using.
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post 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????
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post by ghadacr »

Actually solved that my self...

readonly

Code: Select all

<input readonly type="text"
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You may want to try hidden inputs so they never see it.

Code: Select all

<input type="hidden" value="whatever" />
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post by ghadacr »

No, i want the user to see the data, but thanks for the suggestion :)
Post Reply