Re: Newbie redirect/variable question

From: Date: Thu, 10 May 2001 11:31:41 +0000
Subject: Re: Newbie redirect/variable question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52263@lists.php.net to get a copy of this message
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?

« previous php.general (#52263) next »