On Fri, 11 May 2001, Steve Wade wrote:
> 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
>
I noticed that you were passing the URL like this (from an earlier
message):
> > <a href="redirect.php?fred=www.fusion.org.au">test link</a>
if you put this in Location: without prefixing it with "http://" it may be
treated as a local url or something that is not what you intend. I don't
think it is what is causing this specific error, but it could be the next
one :-))).
--
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]