FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » header function
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: header function [message #172162 is a reply to message #172159] Wed, 02 February 2011 12:39 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 2/2/2011 1:16 PM, Bill B wrote:
> If somepage.php is loaded in a browser, and a script external to
> somepage.php that contains header('Location: somepage.php') is triggered
> by some event, will that call have the effect of refreshing somepage.php?

Bad question. :-)
Let me explain.

Script1: somepage.php

Script2: anotherScript.php
This script contains ONLY header('Location: somepage.php') (for
simplicities sake), so:
<?php
// This is anotherScript.php
header('Location: somepage.php');
exit;
?>

Now, suppose somebody (MrX) has the output of somepage.php in the browser.
And then what happens? (your 'triggered by some event' is a bit vague,
but I think I understand what you mean.)
MrZ now loads anotherScript.php in his browser.
That will result in a header response from the server to the browser.
This response instructs (suggests) the browser of Mr.Z to go to
somepage.php instead.
So Mr.Z will see whatever-it-is-that-somepage.php-produces too.



>
> php.net notes that the "location' string returns a redirect (302) status
> code to the browser. Under these circumstances, the redirect triggered
> by the external script points to the same page currently loaded in the
> browser. Will that choke the browser in any way?
>

I hope this question vanishes after my above explanation.

Regards,
Erwin Moller

> Thank you,
>
> Bill B


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Translate business information for free
Next Topic: Shri Shraddha Astrology
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 01:28:01 GMT 2024

Total time taken to generate the page: 0.04068 seconds