KazeFlame
10-23-2012, 04:08 AM
Error:
Notice: Undefined index: gameid in C:\Xampp\htdocs\index.php on line 5
Code:
<?php
include 'connect.php';
$id = $_POST['gameid'];
$step1 = "select * from flashgames where gameid = '$id'";
$step2 = mysql_query($step1) or die ("Could not select game");
$flashgame = mysql_fetch_array($step2);
echo "<center>";
echo "<h1>" . $flashgame['name'] . "</h1>";
echo "<embed src='" . $flashgame['url'] . "' width='750' height='480'></embed>";
echo "<p>Game played " . $flashgame['playedtimes'] . " times.</p>";
echo "<b>Game Desciption:</b><br/>" . $flashgame['description'];
echo "<br/><b>Genre:</b> " . $flashgame['genre'];
echo "<br/><b>Controls:</b><br/>" . $flashgame['controls'];
echo "<br/><br/>Did you like the game? <!-- Node.js goes here soon --><form action='rate.php?gameid=1' method='get'><input type='button' name='rate' value='YES'/><input type='button' name='rate' value='NO'/></form>";
echo "YES: " . $flashgame['rate-yes'] . "%<br/>NO: " . $flashgame['rate-no'] . "%";
echo "</center>";
?>
:thumbsup: For those who will help. :D
Notice: Undefined index: gameid in C:\Xampp\htdocs\index.php on line 5
Code:
<?php
include 'connect.php';
$id = $_POST['gameid'];
$step1 = "select * from flashgames where gameid = '$id'";
$step2 = mysql_query($step1) or die ("Could not select game");
$flashgame = mysql_fetch_array($step2);
echo "<center>";
echo "<h1>" . $flashgame['name'] . "</h1>";
echo "<embed src='" . $flashgame['url'] . "' width='750' height='480'></embed>";
echo "<p>Game played " . $flashgame['playedtimes'] . " times.</p>";
echo "<b>Game Desciption:</b><br/>" . $flashgame['description'];
echo "<br/><b>Genre:</b> " . $flashgame['genre'];
echo "<br/><b>Controls:</b><br/>" . $flashgame['controls'];
echo "<br/><br/>Did you like the game? <!-- Node.js goes here soon --><form action='rate.php?gameid=1' method='get'><input type='button' name='rate' value='YES'/><input type='button' name='rate' value='NO'/></form>";
echo "YES: " . $flashgame['rate-yes'] . "%<br/>NO: " . $flashgame['rate-no'] . "%";
echo "</center>";
?>
:thumbsup: For those who will help. :D