Showing game category based on the game selection
Posted: Wed Mar 10, 2010 4:49 am
Hi,
First of all i will tell you my assignment. I have some 4 categories like Action Games, Adventure Games, Shooting Games, Casino Games. When i click on the game i want to show the game name from which category that game belongs. For example i have selected a game from "New Games" in those new games category..there are many games which belongs to different categories like Action Games, Adventure Games, Shooting Games, Casino Games. If i select a game then the result should be like "Action" Game if it belongs to action game category. etc...
I have coded the following:
The problem with the above code is whatever the game i selected it shows "Recent Games"..
In my database table i have columns as ID, Name, type etc...
Can anyone provide solution for this..??
First of all i will tell you my assignment. I have some 4 categories like Action Games, Adventure Games, Shooting Games, Casino Games. When i click on the game i want to show the game name from which category that game belongs. For example i have selected a game from "New Games" in those new games category..there are many games which belongs to different categories like Action Games, Adventure Games, Shooting Games, Casino Games. If i select a game then the result should be like "Action" Game if it belongs to action game category. etc...
I have coded the following:
Code: Select all
<?php echo $playGameRow['name'];?> - Free Online <?php
if ($_GET['type'] == "action"){
echo "Action Games";
}
elseif ($_GET['type'] == "arcade"){
echo "Arcade Games";
}
elseif ($_GET['type'] == "adventure"){
echo "Adventure Games";
}
elseif ($_GET['type'] == "puzzle"){
echo "Puzzle Games";
}
elseif ($_GET['type'] == "fighting"){
echo "Fighting Games";
}
elseif ($_GET['type'] == "shooting"){
echo "Shooting Games";
}
elseif ($_GET['type'] == "racing"){
echo "Racing Games";
}
elseif ($_GET['type'] == "sports"){
echo "Sports Games";
}
elseif ($_GET['type'] == "strategy"){
echo "Strategy Games";
}
elseif ($_GET['type'] == "casino"){
echo "Caisno Games";
}
else{
echo "Recent Games";
}
In my database table i have columns as ID, Name, type etc...
Can anyone provide solution for this..??