RE: [PHP] Newbie redirect/variable question

From: Date: Thu, 10 May 2001 11:39:36 +0000
Subject: RE: [PHP] Newbie redirect/variable question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52264@lists.php.net to get a copy of this message
Ok - thanks - my new redirect.php is <?php if ($fred != "") { # $statement = "UPDATE links SET hits=hits+1 WHERE href=\"$u\""; # mysql_query($statement); Header("Location: $fred"); exit; } else { Header("Location: $HTTP_REFERRER"); exit; } ?> I get the following message... Warning: Cannot add header information - headers already sent by (output started at /home/swadie/public_html/redirect.php:2) in /home/swadie/public_html/redirect.php on line 9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Wade Youth Outreach Coordinator Fusion Australia Ltd (Sydney North) ABN 26 001 273 105 +61 2 9477 1110 -----Original Message----- From: Rares [mailto:rares@indaco.ro] Sent: Thursday, 10 May 2001 21:33 To: php-general@lists.php.net Subject: Re: [PHP] Newbie redirect/variable question hey! what's that 'echo' doing there? if you want to use header (and you want to) it must be the firts thing you output from your script so.. first of all loose the 'echo' stuff ----- Original Message ----- From: "Steve Wade" <swadie@zipworld.com.au> > Here's redirect.php: > <?php > echo $fred; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#52264) next »