RE: [PHP] Re: Redirection Question (I spoke to soon)
| From: | Beauford.2005 | Date: | Thu, 24 Jul 2003 19:06:09 +0000 |
| Subject: | RE: [PHP] Re: Redirection Question (I spoke to soon) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156503@lists.php.net to get a copy of this message | ||
Errors are on and I get nothing, it won't even direct if I hard code
header("Location: www.microsoft.com");
-----Original Message-----
From: Jason Wong [mailto:php-general@gremlins.biz]
Sent: July 23, 2003 12:48 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: Redirection Question (I spoke to soon)
On Thursday 24 July 2003 11:37, Beauford.2005 wrote:
> I found one of my problems and also implemented your suggestions, and
> still the same thing. It will not redirect.
>
> The problem I found is that $_SERVER['SERVER_NAME'] does not include
> the port number. On my Win PC I am using port 800. So I changed this
> line
> to:
>
> $_SESSION['goto'] = "http://" .
> $_SERVER['SERVER_NAME'] .":800" .
> $_SERVER['REQUEST_URI'];
>
> If I take the output from that and put it into my browser is works
> just fine, but it will not work in the script.
[snip]
> header("Location: " . $_SESSION['goto']);
>
> If I echo $_SESSION['goto'] right after session_start() it shows
> exactly what it should be. So I am at a loss.
Have you checked your error logs? You should always, ALWAYS have error
reporting on full, and check for errors. It could be that you're getting
an
"headers already sent sent" error.
Does it work if you have a single line script:
header("Location: whatever_$_SESSION['goto']_is_supposed_to_be");
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
But Officer, I stopped for the last one, and it was green!
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php