shage Posted March 14, 2008 Share Posted March 14, 2008 $site = $_GET["site"]; if ($site = "all"){ $site ="allsites"; }elseif ($site = "fob"){ $site ="football"; }elseif ($site = "foo"){ $site ="fooseball"; }elseif ($site = "cri"){ $site ="cricket"; }else{ $site = $_GET["site"]; } for some reason no matter what i put for site i get all sites, what am i doing wrong here Quote Link to comment Share on other sites More sharing options...
dalcacio2007 Posted March 14, 2008 Share Posted March 14, 2008 i dont think the $_GET[] should have quotations that might be the problem $_GET[site] Quote Link to comment Share on other sites More sharing options...
dalcacio2007 Posted March 14, 2008 Share Posted March 14, 2008 wouldnt it be easier to use a switch instead $site = $_REQUEST[site]; switch ($site) { case 'all': $site = 'all'; break; case 'fob': $site = 'football'; break; case 'foo: $site = 'fooseball'; break; case 'cri: $site = 'cricket'; break; } Quote Link to comment Share on other sites More sharing options...
wmguk Posted March 14, 2008 Share Posted March 14, 2008 or try $site = $_GET['site']; also use == if ($site == "all"){ $site ="allsites"; }elseif ($site == "fob"){ Quote Link to comment Share on other sites More sharing options...
shage Posted March 14, 2008 Author Share Posted March 14, 2008 thank you thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.