Re: header("Location:...") fails
| From: | haliphax | Date: | Thu, 14 Jan 2010 14:22:08 +0000 |
| Subject: | Re: header("Location:...") fails | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301101@lists.php.net to get a copy of this message | ||
On Wed, Jan 13, 2010 at 7:02 PM, Shawn McKenzie <nospam@mckenzies.net>wrote:
> Robert Cummings wrote:
> > Just make your life easy and create a redirect() function that generates
> > the header instruction, makes a relative URL into an absolute URL and
> > does the exit call. Then you just need to do:
> >
> > redirect( 'target.php' );
> >
> > Sooooooooo much simpler :)
> >
> > Cheers,
> > Rob.
>
> Definitely! Technically, header() with Location: should have an
> absolute URL, though it works without one most of the time.
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Also, when in doubt, I find it's usually a good idea to check the output
being sent with a more low-level tool, such as Fiddler, so that you can view
the raw values rather than leaving it up to your browser to interpret them.
// Todd