RE: [PHP] redirection to another page function

From: Date: Mon, 23 Apr 2001 01:47:22 +0000
Subject: RE: [PHP] redirection to another page function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49783@lists.php.net to get a copy of this message
At 11:22 23/4/2001 +1000, Jason Murray wrote:
Is there any PHP native function to redirect to another page or URL? No, because you can only redirect a browser to another page using the appropriate HTTP command (it is a header) or JavaScript. I would like that once the user clicks on home.php4 and a few verifications are done, he/she would be redirected to home.html. You can issue a HTTP redirection command to the web browser by using PHP's Header() function. You'll want to use this kind of code: <? Header("Location: http://this.is.the.destination.com/directory/file.php"); ?>
I never had any trouble using header() to redirect, but wouldn't something like this work even better (without worring about previous outputs)?? function redirect($dest) {
        ?>
        <script language="JavaScript">
                parent.location.href='<?=$dest?>';
        </script>
        <?
} it would work wouldn't it? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer

« previous php.general (#49783) next »