RE: [PHP] Redirect
| From: | LeTortorec, Jean-Louis | Date: | Thu, 03 Apr 2003 15:21:33 +0000 |
| Subject: | RE: [PHP] Redirect | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-142150@lists.php.net to get a copy of this message | ||
To work around that "headers already sent" problem, I use:
if ($condition == true) { echo
"<script>location.href=('http://...');</script>"; }
That works great all the time (unless the javascript has been disabled at
the browser side, but usually it's enabled).
Jean-Louis
At 15:55 3-4-2003, you wrote:
>Hi,
>
>How would one redirect a user to a different page if a certain
>condition was met?
>
>i.e.
>
>if($condition == true){
> goTo newPage.php
>}
if ($condition == true)
{
Header("Location:
"http://www.sense.nl/index.php?module=ContentExpress&func=display&ceid=15");
}
take care that your script does not create any output before this,because
then you will get an error (headers already sent)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php