note 79617 rejected from function.header by nlopess
| From: | nlopess@php.net | Date: | Wed, 05 Dec 2007 20:24:20 +0000 |
| Subject: | note 79617 rejected from function.header by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-132860@lists.php.net to get a copy of this message | ||
Note Submitter: facelessone at gmail dot com
----
Hey people,
One thing I noticed is that if you have a file called foo.php which includes a URL bar.php that has
a header("Location: URL"); in it, the 302 is registered but not followed.
IE:
- foo.php: include("http://www.example.com/bar.php");
- bar.php: header("Location: http://www.example.com/folder/index.html");
foo.php will call the bar.php and will result in a blank result as bar.php is resulting in a 302
(redirect).
Before, the 302 was followed and the output was included in the foo.php, not anymore.
I know this sounds odd, but it's a new development I have seen. I might be late in finding out
too, but I never had to look until someone made me spend an hour debugging it. ;)
I tried a few workarounds but none resulted in what I wanted except doing this in bar.php:
<?
$output = file_get_contents("http://www.example.com/folder/index.html");
print $output;
?>
Anybody know a better workaround without touching a different function?
Thanks!