Cursus script

Gestart doorShahiem2 reacties31 weergaven

3 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik maak een website waar je Surinaams kan leren: LeriSrananTongo.com
Maar nu maak een een Cursus script.
Dan staat er een vraag en dan moet je uit vier meerkeuze antwoorden kiezen.

Maar hoe controleer je of je antwoord goed is?
Dus je moet in het adminpaneel een goed antwoord invullen maar hoe check je dat?
0
Berichten
1.544
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met $_POST?
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kijk bijv:

<form action="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]PHP_SELF[/COLOR][COLOR= #007700]];[/COLOR] ?>" method="POST">
<input type="checkbox" value="1" name="1" />
<input type="checkbox" value="2" name="1" /> etc...


En dan met php:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]1[/COLOR][COLOR= #007700])[/COLOR] [COLOR= #FF8000]//Dus laatste waarde is het goede antwoord[/COLOR]
[COLOR= #007700]{[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]Goedzo[/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]Niet goedzo[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren