| |||||
| Dernière réponse | |
|---|---|
| Sujet : ...:::: [php] Probleme CODAGE pour un chtit jeu ::::... | |
| Mara's dad | Soluce sans cookie, mais avec un champ caché !
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if( !isset( $BTN ) ) { /* Attention, cette ligne est indispensable. Elle doit figurer EXACTEMENT comme çà! Elle NE doit PAS être utilisée plus d'une fois par script ! DOC Offcielle : http://www.php.net/manual/en/function.srand.php */ srand((double) microtime() * 1000000); $rond=rand (5, 15); print("taper un nombre entre 5 et 15<BR>" ); printForm( 0, $rond ); } else { if($gil==$rond && $gil>=5 && $gil<=15) { print("oui" ); } else { if($gil<$rond && $gil>=5 && $gil<=15) { print("C plus grand dsl<BR>" ); } elseif($gil>$rond && $gil>=5 && $gil<=15) { print("c plus petit dsl<BR>" ); } else { print("ce nombre n'est pas compris entre 5 et 15<BR>" ); } printForm( $gil, $rond ); } } echo( "<HR>" ); function printForm( $x, $y ) { echo( "<form action=\"rand02.php\" METHOD=\"POST\">\n" ); echo( "<input type=\"text\" name=\"gil\" value=\"$gil\"><br>\n" ); echo( "<input type=\"submit\" NAME=\"BTN\" Value=\"go\">\n" ); echo( "<input type=\"hidden\" name=\"rond\" value=\"$y\"><br>\n" ); } ?> </body> </html> |
| Vue Rapide de la discussion |
|---|