Ik heb een raadhetgetal script met dat als je geen 10 muntjes hebt dat je niet mee kan doen , maar hij wilt niet echt werken?
Kan iemand me helpen:
Script:
Kan iemand me helpen:
Script:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/header.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]//Kijk of er iets verzonden is.[/COLOR]
[COLOR= #0000BB]$geraden[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]getal[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$goed[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Getal kiezen[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uCoins[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]10[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$uCoins[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>Je hebt niet genoeg muntjes om mee te doen.<br
/></strong></div>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$geraden[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]// Kijk of er iets is ingevult.[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>Je moet wel een getal invullen
he.</strong></div>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$geraden[/COLOR][COLOR= #007700])){[/COLOR] [COLOR= #FF8000]//Kijk of er geen cijfers in zitten[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>Een getal heeft cijfers en
geen letters.</strong></div>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$geraden[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]10[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$geraden[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]//Kijk of het onder de 10 zit en [/COLOR]
boven de [COLOR= #0000BB]0[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>Je moet een getal kiezen tussen de 0 en de 10.<br
/></strong></div>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$geraden[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$goed[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]// Als hij het goedgeraden heeft[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div
class="greenerror"><strong>Gefeliciteerd!<br />Je antwoord [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$goed[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] was helemaal
goed.</strong></div>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE member_accounts SET `uCoins`=uCoins + 25 WHERE `uId` = "[/COLOR] [COLOR= #007700].[/COLOR]
[URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Geef de persoon iets als hij het goed had[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [COLOR= #FF8000]//Als de speler het fout heeft.[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>Helaas<br />Het goede antwoord
moest zijn [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$goed[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</strong></div>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE member_accounts SET `uCoins`=uCoins - 25 WHERE `uId` = "[/COLOR] [COLOR= #007700].[/COLOR]
[URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
}
}
}
}
}[/COLOR]
?>
<div class="top">Raad het getal</div><div class="mid">
De bedoeling is dat je een getal van 1 t/m 10 invult.
Als je wint krijg je 10 muntjes, als je verliest dan verlies je 10 muntjes.<br />
<br />
<form action="" method="post">
Getal: <input type="text" name="getal">
<input type="submit" value="Gok">
</form>
</div>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?> 