RE: [PHP] In need of a script
| From: | Wouter van Vliet | Date: | Sun, 24 Aug 2003 22:06:40 +0000 |
| Subject: | RE: [PHP] In need of a script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160601@lists.php.net to get a copy of this message | ||
Though no parse error, it can result in an notice about 'undefined index' ..
I'd prefer
<?php
if (isset($_COOKIE['pagename'])) {
header('Location: /newpage.php');
die;
};
?>
Taking care of three things:
- No undifined index notice
- the cookie can also have a value that evaluates to false
- the 'die;' makes sure the script really ends .. sometimes, somehow for
some
undefined reason it does not stop after a header..
Wouter
-> -----Oorspronkelijk bericht-----
-> Van: Curt Zirzow [mailto:php-general@zirzow.dyndns.org]
-> Verzonden: zondag 24 augustus 2003 20:22
-> Aan: php-general@lists.php.net
-> Onderwerp: Re: [PHP] In need of a script
->
->
-> * Thus wrote Stevie D Peele (sdp2006@juno.com):
-> > Heres what I wrote --
-> >
-> > <?php
-> > if ($_COOKIE['pagename'])
-> > {
-> > header('Location: http://www.net-riches.com/800x600.html');
-> > }
-> > ?>
-> >
-> > and I got a parse error on line 4, but I do not see what is
-> wrong on line
-> > 4!
->
-> There is no parse error in that code.
->
-> Curt
-> --
-> "I used to think I was indecisive, but now I'm not so sure."
->
-> --
-> PHP General Mailing List (http://www.php.net/)
-> To unsubscribe, visit: http://www.php.net/unsub.php