Re: Limitation of redirecting using header()?
| From: | Daniel | Date: | Tue, 10 Apr 2001 21:16:08 +0000 |
| Subject: | Re: Limitation of redirecting using header()? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48081@lists.php.net to get a copy of this message | ||
I might have misread this comment, but I found the opposite.
In one instance, I had:
header("Location: $path/newpage.php");
and in another instance:
header("Location: newpage.php");
The latter (without the path) did update the address bar properly. Of
course, there might have been a problem with the way I was parsing the $path
too.. :/
One other thing for posterity's sake:
I had a difficult time discovering why one of the properties in an object I
was storing via a session was being clobbered. I discovered that it was
because I was assuming that nothing after the header() call mattered. What
I didn't realize was that even though the header was set up to redirect to a
new page, the rest of the code in the page was still executing! I put an
exit() statement after the header() call to prevent this.
Daniel
"Mark Maggelet" <maggelet@mminternet.com> wrote in message
news:200104102003.NAA00559@medusa.mminternet.com...
On Tue, 10 Apr 2001 14:18:54 -0400, Daniel (daniel-php@yipyip.com)
wrote:
>I am writting a session enabled webapp that has a typical login
>page. The
>page submits to itself and upon validation, I want to allow the user
>to
>continue on to the next page.
>
>>From everything I have read so far, the only way to redirect
>programmatically is via header(). Unfortunately, what I'm seeing is
>that
>while the followup page is loaded, the location in the address bar
>(of IE
>5.5) is not updated. Is this something specific to IE? I would
>like the
>address bar to have the correct address instead of the old page.
>
>Any suggestions?
in my experience, using a full url:
header("Location: http://www.mysite.com/mypage.html");
will do what you want while just using a path:
header("Location: /mypage.html");
will not.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net