Hay its me again, Newbie Eryqu...
My new challange is a little game. A High-Low game if you will...
So far you can bet money and the bet amount is shown, if it is less then 5 then an echo is writen and if it is greater then how much money you have... then an echo is writen... this is my code:
<?
$db= mysql_connect("localhost", "", "");
mysql_select_db("",$db);
$table="high-low";
$try = mysql_query("SELECT * FROM $table");
$NumEntries = mysql_num_rows($try);
if($NumEntries == "0") {
$test = "INSERT INTO $table (id, dealer, user, money) VALUES('','', '', '500')";
MYSQL_QUERY($test);
}
$result = mysql_query("SELECT dealer, user, money FROM $table",$db);
$row = mysql_fetch_array($result);
$dealer = $row["dealer"];
$user = $row["user"];
$money = $row["money"];
$test = "<form action=\"high-low.php\" method=\"post\">Bet: <input type=\"text\" name=\"bet1\" size=\"3\" maxlength=\"4\"><br><input type=\"submit\" value=\"Deal\"></form>";
$bla = $_POST['bet1'];
if ($bet1 > $money && $bet1 > 5){
$bet1 = "You dont got enough money sorry";
}
if($bet1 < 5 && $bet1 < $money){
$bet1 = "Sorry cant bet less then 5";
}
echo "<center>
<table border=1 height=400 valign=top>
<tr>
<td width=300 align=center valign=top>
Your Card: <br><br><br><br><h1>$user</h1></td>
<td width=200 valign=middle align=center>
$test<br>Status: $bet1<br><br>
Your Money: <b>$money</b>
</td><td width=300 align=center valign=top>
Dealers Card: <br><br><br><br><h1>$dealer</h1>
</td></tr></table>
</div>
";
?>
Ok... Now i have 1 questions....
How can I make a random # between 1 and 100 show up in the users box and the dealers box...
I am confident that if I find the answer to this questionsi can finish anything else on my own
Thanks guys!
Erik~~~