Hey guys i'm upgrading guess the number game i created, i saved the number on a text file but i had problems if many users played the game simultaneously because the number gets overwritten so now i want to use a database to store the number where a nickname, ip address, generated number and user id will be stored. But now the game shows blank pages can you help? Here's the source code
PHP Code:
<html>
<head>
<title>wapEvening | Guess the number game</title>
<link rel="stylesheet" type="text/css" href="includes/style.css"/>
</head>
<body>
<?php
require_once "includes/header.inc";
require_once "includes/con.inc";
$ran = rand(1,50);
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$insert = "INSERT INTO *** (id,ip,number)
VALUES(NULL,{$ip},{$ran})";
$enter = @mysql_clean(mysql_query($insert));
print 'Welcome to guess the number game, you have 5 chances to guess the number between 1 and 50
(included) you loose 10 points for every incorrect number you guess, you get a bonus of 20
points if you guess correct number first time';
$nick = print '<input type="text" size="5" maxlength="10" name="nick">';
$guess = print '<input type="text" size="1" maxlength="1" name="guess">';
print "\nEnter :\n<form action=\"gtn_answer.php\" method=\"POST\">Nickname : ".$nick."\nYour
guess : ".$guess."</form>";
?>
</body>
</html>
Comment