Re[2]: [PHP] Newbie redirect/variable question

From: Date: Thu, 10 May 2001 14:07:33 +0000
Subject: Re[2]: [PHP] Newbie redirect/variable question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52283@lists.php.net to get a copy of this message
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:kruse@get2net.dk] Sent: Friday, 11 May 2001 0:00 To: php-general@lists.php.net 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"" <swadie@zipworld.com.au> wrote in message news:MABBKCBDLHPGCKNPPFEKEELHCFAA.swadie@zipworld.com.au... > 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: 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 (#52283) next »