On Thu, 10 May 2001, Steve Wade wrote:

> I'm trying to get a redirect working - never done one before.
>
> Here's the line from the referring page (index.php3):
>
> <a href="redirect.php?fred=www.fusion.org.au">test link</a>
>
> Here's redirect.php:
>
> <?php
> echo $fred;

I don't think you can output anything like this to the browser before you
issue a header statement. Try it without the echo $fred :)

>
> if ($fred != "") {
> #     $statement = "UPDATE links SET hits=hits+1 WHERE href=\"$u\"";
> #     mysql_query($statement);
>     Header("Location: $fred");
>     exit;
> } else {
>     echo "Didn't work\n";
> #     Header("Location: $HTTP_REFERRER");
>     exit;
> }
> ?>
>
> it just skips straight to the else statement. (
>
> Can anyone see what I'm getting wrong?


-- 
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