Okay. I reworked the code a bit, but still no go.

Here is what I have:

$redirect = "http://"; . $_SERVER['HTTP_HOST'] . "/cm/clients/viewclient.php?id={$_REQUEST['id']}&foo=bar";
error_reporting(E_ALL);
echo "Location: $redirect";
header("Location: $redirect");


I get NO errors at all :(
It was my understanding that the only thing I needed to worry about breaking this, would be if there was some output before the header(). There is not, but there are some variables getting set etc.


Anyone else think of anything?

Thanks

On Dec 1, 2003, at 4:48 PM, Chris Shiflett wrote:

--- rogue <[EMAIL PROTECTED]> wrote:
$redirect = "viewclient.php?id={$_REQUEST['id']}&foo=bar";
header("Location: $redirect");

Only, nothing happens when this code is executed.

I would try two things, in this order:


1. Use a full URL. A Location header is defined in the specification as
taking a full URL as an argument. You are using a relative one, which is
incorrect.


2. Replace your header call with an echo. Basically, rather than
header("Location: $redirect") use echo "Location: $redirect" instead. This
might reveal typos or other problems that are more difficult to inspect
when in the HTTP headers instead of the content.


Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to