|
Posted by John on 11/15/05 13:41
On 15 Nov 2005 02:44:40 -0800, "Oli Filth" <catch@olifilth.co.uk>
wrote:
>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.
Thanks Oli
It may be elegant but I get the ubiquitous 'headers already sent'
error. Javascript solves this easily.
What is the simple solution to that problem (without me having to read
a 176 page document).
Elegant is OK so long as it doesn't require reams of code. If it is
simple I will do it.
--
John
[Back to original message]
|