RE: [PHP] Whats the "php" way of redirecting to a new .php file please?
| From: | James Moore | Date: | Sat, 26 Aug 2000 18:05:57 +0000 |
| Subject: | RE: [PHP] Whats the "php" way of redirecting to a new .php file please? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13799@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Eric Carlson [mailto:stargazer@blueyonder.co.uk]
> Sent: 26 August 2000 18:59
> To: php-general@lists.php.net
> Subject: [PHP] Whats the "php" way of redirecting to a new .php file
> please?
>
>
> (Newbie alert!)
>
> Say I'm in one .php file and I know when a certain test is true I
> just want to get out and load another file, just like the user had
> clicked an <a href> or clicked the submit button of a <form>. Whats
> the smart way to do it please? Conceptually I need:
>
> <?php
> if ($thevalue == "Go")
> {
> gotopage("newpage.php");
> }
> ?>
>
> Thanks very much in advance...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
<?php
if ($thevalue == "Go")
{
header("Location: newpage.php");
}
?>
This must be before any output.
James