ID:               44479
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ingo dot kasch at gmx dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP Professional
 PHP Version:      5.2.5
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

constants aren't parsed in strings.

header("Location: " . HOME);



Previous Comments:
------------------------------------------------------------------------

[2008-03-19 12:53:41] ingo dot kasch at gmx dot de

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 this bug report at http://bugs.php.net/?id=44479&edit=1

Reply via email to