note 79617 added to function.header
| From: | facelessone at gmail dot com | Date: | Wed, 05 Dec 2007 18:37:06 +0000 |
| Subject: | note 79617 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132854@lists.php.net to get a copy of this message | ||
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!
----
Server IP: 69.147.83.197
Probable Submitter: 204.92.87.230
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/79617
Del: integrated -- https://master.php.net/note/delete/79617/integrated
Del: useless -- https://master.php.net/note/delete/79617/useless
Del: bad code -- https://master.php.net/note/delete/79617/bad+code
Del: spam -- https://master.php.net/note/delete/79617/spam
Del: non-english -- https://master.php.net/note/delete/79617/non-english
Del: in docs -- https://master.php.net/note/delete/79617/in+docs
Del: other reasons-- https://master.php.net/note/delete/79617
Reject -- https://master.php.net/note/reject/79617
Search -- https://master.php.net/manage/user-notes.php