From: ingo dot kasch at gmx dot de
Operating system: Windows XP Professional
PHP version: 5.2.5
PHP Bug Type: Scripting Engine problem
Bug description: Error while using a constant in header()-function
Description:
------------
Hi,
while using a constant for defining a hyperlink-target (http-adress) and
using this constand to do a header();redirect there comes an object not
found-error (404) in the browser.
The reason is that php could not interpret the value of the constant and
using the constants name for the header();-function.
Reproduce code:
---------------
Not working code:
<?php
define('HOME', 'http://www.google.de');
header("Location: HOME");
?>
WORKING CODE:
<?php
define('HOME', 'http://www.google.de');
$home_var = HOME;
header("Location: $home_var");
?>
Expected result:
----------------
I expected a redirct to the defined value of the constant, in this example
'http://www.google.de'.
Actual result:
--------------
The browser is redircting to /HOME using the actual url of the page and
just adding /HOME (which is the name of the constant, not the value) in the
end of the adress bar.
--
Edit bug report at http://bugs.php.net/?id=44479&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44479&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44479&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44479&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44479&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44479&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44479&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44479&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44479&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44479&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44479&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44479&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44479&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44479&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44479&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44479&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44479&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44479&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44479&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44479&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44479&r=mysqlcfg