Well, that just means you have to rewrite the line:
    header("Location: $HTTP_GET_VARS['fred']");
like this:
    header("Location: " . $HTTP_GET_VARS['fred']);

But have you tried it with just $fred? You shouldn't have to use
$HTTP_GET_VARS.

Regards,
Jakob Kruse

""Steve Wade"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks - hmm - doesn't seem to do it though.
>
> My current code is:
>
> <?php
>
> if ($HTTP_GET_VARS['fred'] != "") {
> #     $statement = "UPDATE links SET hits=hits+1 WHERE href=\"$u\"";
> #     mysql_query($statement);
>     header("Location: $HTTP_GET_VARS['fred']");
>     exit;
> } else {
>     header("Location: $HTTP_REFERRER");
>     exit;
> }
> ?>
>
> which gives an error msg:
>
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING' in /home/swadie/public_html/redirect.php on line 6
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Steve Wade
> Youth Outreach Coordinator
> Fusion Australia Ltd (Sydney North)
> ABN 26 001 273 105
> +61 2 9477 1110
>
>
> -----Original Message-----
> From: Jakob Kruse [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 11 May 2001 0:00
> To: [EMAIL PROTECTED]
> Subject: Re: Re[2]: [PHP] Newbie redirect/variable question
>
>
> You should probably urlencode the address first, like this:
>
> <a href="redirect.php?fred=<?php echo urlencode("www.fusion.org.au")
> ?>">test link</a>
>
> Not sure if it solves the problem though.
>
> Regards,
> Jakob Kruse
>
> ""Steve Wade"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Ahh - thanks - that's helped :-) (Line 9 was the http_referrer line)
> >
> > Now the only trouble is, it seems to still treat $fred as null.
> >
> > The passing line is from index.php:
> >
> > <a href="redirect.php?fred=www.fusion.org.au">test link</a>
> >
> >  Should this work?
> >
> > Thanks,
> >
> > Steve
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Steve Wade
> > Youth Outreach Coordinator
> > Fusion Australia Ltd (Sydney North)
> > ABN 26 001 273 105
> > +61 2 9477 1110




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to