redirect - php script redirecting code problem -


i'm using php script redirection after detecting search word websiter search engines .

and redirection code working fine

but keywods wat stay in same page. lines of code i'm getting warning message in pages.

warning:  headers sent            (output started @ /home/friendsj/public_html/index.php:2) in           /home/friendsj/public_html/index.php on line 20 

below code used in pages

$ref=$_server['http_referer'];  if(strstr($ref,"test")){    $url="http://www.howtomark.com/robgoyette.html"; } else if(strstr($ref,"mu+word+gmail")){     $url="http://www.howtomark.com/marketbetter.html"; } else{   if(strstr($ref,"how+to+market+better")){   }     }  if($url !=""){   header("location:$url"); } 

redirections accomplished setting http header, use of header() function suggests. means can redirect before start document output. whatever start printing on line 2, later ;-)


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -