|
Posted by Paul Waring on 10/12/91 11:29
On Sun, Oct 16, 2005 at 05:04:09PM +0200, Dotan Cohen wrote:
> header ("Location: ".$url);
> ?>
>
> Does this seem like it should work? It doesn't. What is the correct
> syntax for these things?
That code should work, and the example on your site seems to work for
me. The only thing you should make sure is that $url is an absolute URL,
even if you're redirecting within your own site (e.g. you shouldn't use
.../lyrics/ or /lyrics/) - you may be able to get away without doing this
but it's not the "correct" way to do things.
You may want to change your code to this:
header("Location: $url"); // no point in concatenating since double
quotes will interpolate the value of $url anyway
exit();
I can't remember why, but calling the exit(); function fixed a problem I
was having a while back when I was being sent to the right URL but the
old one was staying in my browser address bar.
Paul
--
Rogue Tory
http://www.roguetory.org.uk
Navigation:
[Reply to this message]
|