het is een kop of munt spelletje, maar bij het mijne is het onmogelijk te winnen...

- Spoiler: bekijk
- <?php /* ------------------------- */
$UPDATE_DB = 1;
if($_POST['inzet'] > 25000 OR $_POST['inzet'] < 0){
echo "<table width=100%><tr><td class=subtitle><b>Cheaten</b></tr></td>";
echo "<tr><td class=mainTxt>Niet cheaten</td></tr></table>";
exit;
}
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>gtagamers wargame</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<link rel="stylesheet" type="text/css" href="css-v1.css">
<?PHP
$answer = $_GET['answer'];
$genoegcash = "200";
$random_number_max = rand(1,100);
$random_number_min = rand(1,100);
$random_number = rand($random_number_min,$random_number_max);
$random_number_max2 = rand(1,100);
$random_number_min2 = rand(1,100);
$random_number2 = rand($random_number_min2,$random_number_max2);
$hogerlager3 = mysql_query("SELECT `login`, `number`, `round` FROM `hogerlager` WHERE `login`='{$data->login}'");
$hl_gegevens = mysql_fetch_object($hogerlager3);
if(empty($hl_gegevens->round)) {
$hl_ronde = 1;
}
else {
$hl_ronde = $hl_gegevens->round + 1;
}
?>
<?PHP
if(mysql_num_rows($hogerlager3) == 0) {
$insert_hl = "insert into hogerlager (`login`, `number`, `round`) VALUES ('$data->login','$random_number','0')";
$insert_hl = mysql_query($insert_hl) or die("FOUT : " . mysql_error());
}
?>
<?PHP
if (isset($_GET['answer'])) {
if($genoegcash > $data->cash && $hl_ronde == 1) {
echo "<table align=center width=100%>
<tr><td class=subTitle><b>Hoger Lager</b></td></tr>
<tr><td class=mainTxt>
Je hebt niet genoeg geld in je portefeuille.";
echo " </td></tr>
</table><br>";
}
else {
if($hl_ronde == 1) {
$buy_hl = "UPDATE `[users]` set `cash`=`cash`-'$genoegcash' WHERE `login` = '{$data->login}'";
$buy_hl_now = mysql_query($buy_hl) or die("FOUT : " . mysql_error());
}
$random_number2 = $hl_gegevens->number;
if($random_number2 > 50) { $random_quest = "hoger"; }
if($random_number2 < 50) { $random_quest = "lager"; }
if($random_number2 == 50) { $random_quest = $answer; }
if($answer == $random_quest) {
$update_hl = "UPDATE `hogerlager` set `round`=`round`+'1', `number` = '$random_number' WHERE `login` = '{$data->login}'";
$update_hl_now = mysql_query($update_hl) or die("FOUT : " . mysql_error());
echo "<table align=center width=100%>
<tr><td class=subTitle><b>Hoger Lager</b></td></tr>
<tr><td class=mainTxt>
Je raadde het goede antwoord. <a href=\"hogerlager.php\">Klik hier om naar de volgende ronde te gaan.</a>";
echo " </td></tr>
</table><br>";
}
if($answer != $random_quest) {
if($hl_gegevens->round == 0) {
$geld_won = 0;
}
if($hl_gegevens->round == 1) {
$geld_won = 250;
}
if($hl_gegevens->round == 2) {
$geld_won = 750;
}
if($hl_gegevens->round == 3) {
$geld_won = 1000;
}
if($hl_gegevens->round == 4) {
$geld_won = 1250;
}
if($hl_gegevens->round == 5) {
$geld_won = 1500;
}
if($hl_gegevens->round == 6) {
$geld_won = 3000;
}
if($hl_gegevens->round == 7) {
$geld_won = 3750;
}
if($hl_gegevens->round == 8) {
$geld_won = 5750;
}
if($hl_gegevens->round == 9) {
$geld_won = 8000;
}
if($hl_gegevens->round == 10) {
$geld_won = 11000;
}
if($hl_gegevens->round == 11) {
$geld_won = 15000;
}
if($hl_gegevens->round >= 12) {
$geld_won = 20000;
}
if($hl_gegevens->round >= 13) {
$geld_won = 25000;
}
$set2bank = "UPDATE `[users]` set `cash`=`cash`+'$geld_won' WHERE `login` = '{$data->login}'";
$set2bank_now = mysql_query($set2bank) or die("FOUT : " . mysql_error());
$delete_hl = "DELETE FROM `hogerlager` WHERE `login` = '{$data->login}'";
$delete_hl_now = mysql_query($delete_hl) or die("FOUT : " . mysql_error());
echo "<table align=center width=100%>
<tr><td class=subTitle><b>Hoger Lager</b></td></tr>
<tr><td class=mainTxt>Helaas. Je raadde niet het goede antwoord. Je hebt $ $geld_won gewonnen.";
echo " </td></tr>
</table><br>";
}
}
}
else {
echo "<table align=center width=100%>
<tr><td class=subTitle><b>Hoger of lager?</b></td></tr>
<tr><td class=mainTxt>
Prijzen:<br>
1 goed = 250$<br>
2 goed = 750$<br>
3 goed = 1000$<br>
4 goed = 1250$<br>
5 goed = 1500$<br>
6 goed = 2000$<br>
7 goed = 3750$<br>
8 goed = 5750$<br>
9 goed = 8000$<br>
10 goed = 11000$<br>
11 goed = 15000$<br>
12 goed = 20000$<br>
13 goed = 25000$<br>
<br><br><br>
Meedoen aan hoger of lager kost 200$. <br>
Er wordt een random getal t/m de 100 gecreeërd.<br>
Je kan het spel tussendoor stoppen en later verder gaan.
<br><br>
";
?>
<?PHP
echo "Ronde $hl_ronde : Hoger of lager dan $random_number2";
echo "?";
?>
<?PHP
echo "
<br><br>
<form>
<input type=\"button\" value=\"Ik gok hoger dan $random_number2\"
onClick=\"window.self.location=('hogerlager.php?answer=hoger');\">
</form>
<form>
<input type=\"button\" value=\"Ik gok lager dan $random_number2\"
onClick=\"window.self.location=('hogerlager.php?answer=lager');\">
</form>
";
echo " </td></tr>
</table><br>";
}
?>
<?PHP
echo "
</body>
</html>
";
?>