Ik heb een raad het getal script maar hij is niet echt goed gescript.
Ik wil dat je alleen cijfer van 1 t/m 10 kan invullen.
En dat je geen letters kan invullen.
Ik heb ook iets gemaakt als je niet genoeg muntjes hebt dat je dan een melding krijgt maar dat wil neit echt werken.
Kan imenad me helpen?
Code:
Ik wil dat je alleen cijfer van 1 t/m 10 kan invullen.
En dat je geen letters kan invullen.
Ik heb ook iets gemaakt als je niet genoeg muntjes hebt dat je dan een melding krijgt maar dat wil neit echt werken.
Kan imenad me helpen?
Code:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_auth[COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/srand"]srand[/URL][COLOR= #007700]((double)[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]() *[/COLOR] [COLOR= #0000BB]100000[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$te_raden_getal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]uCoins [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]||[/COLOR] uCoins [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]10.00[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt niet genoeg muntjes[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #0000BB]$antwoord[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]antwoord[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$antwoord[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$antwoord[/COLOR] [COLOR= #007700]<>[/COLOR] [COLOR= #0000BB]$te_raden_getal[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<div class="rederror"><br /><strong>Je hebt verloren, het goede antwoord was [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$te_raden_getal[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</strong><br
/>Je verliest 10 muntjes.</div><meta http-equiv="refresh" content="3;url=index.php?p=raadhetgetal">[/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-10 WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or
[URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<div class="rederror"><br /><strong>Je hebt gewonnen, je krijgt 10 muntjes.</strong></div><meta
http-equiv="refresh" content="3;url=index.php?p=raadhetgetal">[/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+10 WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or
[URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());;[/COLOR]
[COLOR= #0000BB]$te_raden_getal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<div class="top">Raad het Getal</div><div class="mid">
<form action="" method="post">
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 />
Antwoord <input name="antwoord" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$antwoord[/COLOR]?>"><br>
<input type="hidden" name="te_raden_getal" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$te_raden_getal[/COLOR]?>">
<br />
<input type="submit" value="Starten!">
</form>
</div>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror"><br /><strong>U moet ingelogd zijn om deze pagina te bekijken.</strong><br> <a
href="index.php?p=login">Log hier in</a> of <a href="index.php?p=registreer">maak een account aan.</a></div>[/COLOR][COLOR= #007700];
}[/COLOR]
?> 