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 Link to comment https://forums.phpfreaks.com/topic/96192-_get/ 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] Link to comment https://forums.phpfreaks.com/topic/96192-_get/#findComment-492412 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; } Link to comment https://forums.phpfreaks.com/topic/96192-_get/#findComment-492414 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"){ Link to comment https://forums.phpfreaks.com/topic/96192-_get/#findComment-492415 Share on other sites More sharing options...
shage Posted March 14, 2008 Author Share Posted March 14, 2008 thank you thank you Link to comment https://forums.phpfreaks.com/topic/96192-_get/#findComment-492419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.