redirection...

From: Date: Thu, 13 Jul 2000 18:21:16 +0000
Subject: redirection...
Groups: php.general 
Request: Send a blank email to php-general+get-6519@lists.php.net to get a copy of this message
hi list, have a look at the code below... <? session_start(); ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <? global $linkid; switch($linkid){ case 1: header("location: http://www.yahoo.com"); break; case 2: header("location: http://www.google.com"); break; } ?> it gives me the error that: Warning: Cannot add header information - headers already sent by (output started at /home/subhra/public_html/php/al/test.php:2) in /home/subhra/public_html/php/al/test.php on line 7 the error is pretty obvious ... since the header is already sent .. hence resending another header generates this warning and the switch doesnot get processed... how do i go about redirecting... under such circumstances... am i missing something.. please help .. i am stuck .... -------------------------------------------------------------------------------------- SECURITY IS A MYTH........!!!!!!!! "Linux for people with avg. IQ above 98" -------------------------------------------------------------------------------------- Subhrajyoti Moitra ------- C/212 Hall-I IIT-Kanpur India 208016 email: subhra@iitk.ac.in

« previous php.general (#6519) next »