Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199901

Re: [PHP3] my mistake or php3 bug with cookies From: Paul Lynch (plynch <email protected>)
Date: 01/22/99

okay, perhaps I should have included a sample of the code we are trying to
write. As you can see we tried adding the no cache header to the page and it
still required that we hit refresh in the browser window before the page
noticed it didn't have a value from the cookie. For what it is worth we are
also using phplib as well, as we need the persistant variables frm page to
page. We would greatly appreciate any help or suggestions you could offer
us at
this point as we feel like we are hitting our heads against a brick wall on
this. I am also going to include a second variatin that we tried, which is
definitely different in its approach, but still gives us the same result that
we have to refresh the page before it realizes it doesn't recognize you and
send you on your way. Thanks in advance for any help. Paul
#!/usr/local/bin/php
 "Poe_Session")); if ($userid == "") { $userid =
$HTTP_COOKIE_VARS["permid"]; }
if ($userid == "") { header("Location: ".
$sess->url("http://host.simstar.com/Cl99/entry1.php3")); } if
(!($HTTP_POST_VARS[psych2] == "")) { $psychB = $HTTP_POST_VARS[psych2]; }
page_close(); ?>
LAA Variables:
"; print "PA: $pA
"; print "PB: $pB
"; print "URL: " . $sess->self_url() . "
"; print "Visitor Userid: " . $userid . ""; ?> ------------------- End
Example
1 #!/usr/local/bin/php "Poe_Session")); if ("" == $userid) { switch
($sess->mode) { case "get": if (isset($HTTP_GET_VARS[$userid])) { $userid =
$HTTP_GET_VARS[$userid]; } else { header("Location:
http://host.simstar.com/T2/entry1.php3"); } break; case "cookie": if
(isset($HTTP_COOKIE_VARS[$userid])) { $userid = $HTTP_COOKIE_VARS[$userid]; }
else { header("Location: http://host.simstar.com/T2/entry1.php3"); } break;
} }
if ($pA == "") { $pA = $HTTP_GET_VARS[p1]; } if ($pB == "") { $pB =
$HTTP_GET_VARS[p2]; } page_close(); ?> .... At 06:02 PM 1/21/99 -0500, you
wrote: >> Any reason why I have to hit refresh before it realizes the cookie
value is >> empty? What is different about the page when it loads the first
time and a >> refresh? > >Nothing, your code is wrong. > >-Rasmus >

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>