# Strange roblems with sessions

- Thread: https://externals.io/message/2394
- Original archive: https://news-web.php.net/php.internals/2394
- Started by Logan McKinley on 2003-06-18T18:51:06+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #2394 — Logan McKinley — 2003-06-18T18:51:06+00:00

URL: https://externals.io/message/2394#2394

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

---

## #2395 — Steve Keller — 2003-06-18T19:19:06+00:00

URL: https://externals.io/message/2394#2395 · In reply to: #2394

At 6/18/2003 02:51 PM, Logan McKinley wrote:

 > <------  the code in question -------->
 > I have attached the actual files if that would be of more help,
 > Thanks in advance for any help,

The first thing that I noticed is that you're doing error checking in 
"registration_form.php", but your form is posting to "Register.php." If the 
data is being set in "Register," but you're looking for validation in 
"registration_form," you're going to get an error.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: skeller@healthtvchannel.org
Web: www.healthtvchannel.org
