|
Posted by Dotan Cohen on 10/20/12 11:29
On 10/16/05, Paul Waring <paul@xk7.net> wrote:
> 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
>
Thanks, Paul. I stuck $url inside the double quotes, like you said. I
also added the exit; function. No go for me. I get a blank page.
You say that it worked for you? Where did it take you? It _should_
take you to another lyrics site. Did you stay on http://lyricslist.com
or go somewhere else?
Thank you.
Dotan
Navigation:
[Reply to this message]
|