Код:
<?php
/**
* @author
* @copyright 2010
*/
$dealer = rand(4,21);
$you = rand(4,21);
$deal = 0;
if (isset($_POST['deal'])) {
$deal +=1 ;
} else {
$deal = 0;
echo "natisnete deal za da zapo4nete";
}
if ($deal == 0 ) {
$htmlform = "<input type = submit name=deal value=deal>";
} else {
$htmlform .= "<input type=submit value=stand name=stand>";
$htmlform .= "<input type=submit value=hit name=hit>";
$dealer = rand(4,21);
$you = rand(4,21);
echo "Ti imash $you , Dilarat ima $dealer";
}
if (isset($_POST['hit'])) {
$hitt=rand(1,11);
$deal = 1;
$you=$you + $hitt;
}
if (isset($_POST['stand'])) {
$dealer+=rand(1,11);
}
?>
<html>
<head>
<title>Bjack</title>
</head>
<body>
<form action="" method="POST">
<?php echo "$htmlform"; ?>
</form>
</body>
</html>