Re: Opening a new page when done
| From: | Chuck | Date: | Wed, 24 Oct 2001 20:32:20 +0000 |
| Subject: | Re: Opening a new page when done | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72158@lists.php.net to get a copy of this message | ||
If you are going to use the javascript solution, be sure to add a <noscript>
container for browsers that do not support javascript or have it disabled:
<SCRIPT language="JavaScript1.1">
<!--
location.replace("new-location.html");
//-->
</SCRIPT>
<NOSCRIPT>
<META http-equiv="Refresh" content="0; URL=wheredoyouwanttogotoday.ugh">
</NOSCRIPT>
Of course, pure PHP is far superior... :-)
Chuck
James Fairbairn wrote:
> just print the following at the point where you decide you want to redirect:
>
> <script language="JavaScript">
> <!--
> location.href="whereveryouwannago.php";
> //-->
> </script>
>
> a better alternative is to send a redirection header with the response, but
> this depends on you not sending any HTML output to the browser before
> processing is complete:
>
> <?php
> header("Location: whereveryouwannago.php");
> exit; // don't do any more processing after this redirect.
> ?>
>
> hope this helps.
>
> james