|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-02-19 19:16 UTC] cpuidle at gmx dot de
Description:
------------
Sending Location headers in php 5.3.1 does set return status to 302 but does not relay the location header to the client app- preventing redirection from working.
Reproduce code:
---------------
<?php
header("Location: other.php");
?>
Expected result:
----------------
Should open the other.php page.
Actual result:
--------------
Nothing. Following output is captured by Firefox- it shows that the location header is missing:
GET /videodb/test.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: VDBuserid=1; VDBusername=admin; VDBpassword=368368530; PHPSESSID=1ka2had3fipg89rkt7o9v6s601
Cache-Control: max-age=0
HTTP/1.1 302 Found
Date: Fri, 19 Feb 2010 19:10:41 GMT
Server: Apache/2.2.11 (Win32) PHP/5.3.1
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Before anybody points me to the HTTP 1.1 spec- this one doesn't redirect either on 5.3.1: <?php header('Location: http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\').'/other.php'); ?> Best regards, Andreas