Ruko Posted November 23, 2009 Share Posted November 23, 2009 HELP! How do i make a url like this domain.com/play.php?game=cswd instead of using many php files. Link to comment https://forums.phpfreaks.com/topic/182602-help-how-do-i/ Share on other sites More sharing options...
oni-kun Posted November 23, 2009 Share Posted November 23, 2009 You can have code like if ($_GET['game']=='game1') { echo "<embed game1../>"; }elseif (.....) { echo "Game2: <embed...>"; } in successive IF statements like that, or use a database. Link to comment https://forums.phpfreaks.com/topic/182602-help-how-do-i/#findComment-963754 Share on other sites More sharing options...
iversonm Posted November 23, 2009 Share Posted November 23, 2009 Also I would just like to say you should read stickies. It specifically says do not title your posts as "help". Link to comment https://forums.phpfreaks.com/topic/182602-help-how-do-i/#findComment-963756 Share on other sites More sharing options...
onlyican Posted November 23, 2009 Share Posted November 23, 2009 You also have the SWITCH option switch($_GET["game"]){ case "game1": echo "<embed game1../>"; break; case "game": echo "<embed game2../>"; break; default: //Capture any failed statements. echo "no game found"; } Link to comment https://forums.phpfreaks.com/topic/182602-help-how-do-i/#findComment-963845 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.