? symbol being escaped when using header(Location: ...)
Posted: Fri Aug 22, 2008 4:24 am
Hi,
I'm trying to redirect the one of my page to another site where I need to pass some values to.
An example of the code I'm using:
/* Note: $picture value is calculated before and assumes a numeric value */
$url = "http://www.sanzanne.com/showpicture.php";
$redirect = $url.'?picture='.$picture;
header("Location: $redirect");
die;
If I do an "echo $redirect;" the result is: http://www.sanzanne.com/showpicture.php?picture=19
However, when the header comes in to play the result is: http://www.sanzanne.com/showpicture.php/?picture=19
As you can see instead of having a simple ? I'm getting a /?
This means that the picture parameter is ignored and no value is passed to the page showpicture.php.
How can I solve this?
Cheers!
I'm trying to redirect the one of my page to another site where I need to pass some values to.
An example of the code I'm using:
/* Note: $picture value is calculated before and assumes a numeric value */
$url = "http://www.sanzanne.com/showpicture.php";
$redirect = $url.'?picture='.$picture;
header("Location: $redirect");
die;
If I do an "echo $redirect;" the result is: http://www.sanzanne.com/showpicture.php?picture=19
However, when the header comes in to play the result is: http://www.sanzanne.com/showpicture.php/?picture=19
As you can see instead of having a simple ? I'm getting a /?
This means that the picture parameter is ignored and no value is passed to the page showpicture.php.
How can I solve this?
Cheers!