----- Original Message ----- From: "Logan McKinley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, June 18, 2003 12:51 PM Subject: [PHP] Strange roblems with sessions
> what it is meant to do: > take a querystring set it to a session variable (outputs error if neither > querystring nor sesison exist) then reloads the page (to remove the > querystring) > what it (appears) to do: > it sets the querysting to the session, reloads the page and outputs an error > saying it doesn't have the session variable > if you reload the page with a querystring back in and it works as it is > meant to > <------ the code in question --------> > <? > session_start(); > if(!isset($_SESSION['HID']) && !isset($_SERVER['QUERY_STRING'])) > die("There was an error registering your product please call techinal > support at (111)-111-1111"); > else if(!isset($_SESSION['HID']) && isset($_SERVER['QUERY_STRING'])) > { > $_SESSION['HID'] = $_SERVER['QUERY_STRING']; > header("Location: http://localhost/PHP/registration_form.php"); > } > ?> > <---------------------------------> > I have attached the actual files if that would be of more help, > Thanks in advance for any help, > ~Logan Logan, When you're activating the script through the browser then $_SERVER['QUERY_STRING'] is always set. It is only empty or not empty. You should modify your conditional statements to reflect that.. <? session_start(); if(!isset($_SESSION['HID']) && empty($_SERVER['QUERY_STRING'])) { die("There was an error registering your product please call techinal support at (111)-111-1111"); } elseif(!isset($_SESSION['HID']) && !empty($_SERVER['QUERY_STRING'])) { $_SESSION['HID'] = $_SERVER['QUERY_STRING']; header("Location: http://www.helpelf.com/test2.php"); } ?> This is tested. HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php