Hey im having a problem figuring out how to do this with php. What iam trying to do is $game=$_GET['game']; the file from the URL bar and then i want it to check the mysql database to see if that game actually exists, i don't want people inserting random names to my url bar, and if it doesn't exists i want it to print out somthing like "that file or game doesn't exist on the server". Anybody have an idea of how to make this happen?
$game = $_GET['game']; $result = mysql_query("SELECT * FROM games WHERE game_title = '" . mysql_real_escape_string($game) . "'"); if(mysql_num_rows($result)) { // do whatever you have to do... } else { echo "That file or game doesn't exist on the server"; } PHP: