|
Posted by Oli Filth on 11/15/05 12:44
John wrote:
> On 14 Nov 2005 04:56:30 -0800, "Gazornenplat" <ianbambury@gmail.com>
> wrote:
>
> ><?php
> >$page='page2.php'; // set page to anything you like via your lookup
> >if(isset($_REQUEST['data']))
> >{
> > echo "<script>document.location.replace('$page');</script>";
> > exit; // Stops further pointless processing
> >}
> >echo isset($_REQUEST['data']);
> >?>
> ><html>
> ><head><title></title></head>
> ><body>
> ><form>
> ><input name="data" type="text">
> ><input type="submit">
> ></form>
> ></body>
> ></html>
>
> Thanks for the suggestions and to Ian and Gazornenplat
> document.replace worked perfectly.
>
> Curious to know what this is doing differently to windows.location
> though.
>
IMO, Philip's suggestion(s) would be far more appropriate.
If you're using PHP, why not use it's ability to create an "official"
HTTP redirect, rather than rely on Javascript?
Using JS only leads to problems (as you've seen), and may be disabled
by the user, rendering your navigation inoperable.
That's one of the reason PHP exists! To allow you to avoid doing things
crappily and unreliably in JS, replacing it with an elegant, reliable
server-side solution.
--
Oli
[Back to original message]
|