Bonjour le forum,
Je voudrais envoyé des données par rapport plusieurs chexbox et les récupérer dans une autre page.
dans la première page :
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <form action="etalon1.php" method="post" > 1°) Le nom du mâle ? <br> <input type="checkbox" value="ane" name="ane"><img src="ane.jpg" width="80" height="80"> <input type="checkbox" value="belier" name="belier"><img src="belier.jpg" width="80" height="80"> <input type="checkbox" value="bour" name="bouc"><img src="bouc.jpg" width="80" height="80"> <br> <input type="checkbox" value="canard" name="canard"><img src="canard.jpg" width="80" height="80"> <input type="checkbox" value="chat" name="chat"><img src="chat.jpg" width="80" height="80"> <input type="checkbox" value="chien" name="chien"><img src="chien.jpg" width="80" height="80"> <br> <input type="checkbox" value="coq" name="coq"><img src="coq.jpg" width="80" height="80"> <input type="checkbox" value="dindon" name="dindon"><img src="dindon.jpg" width="80" height="80"> <input type="checkbox" value="etalon" name="etalon"><img src="etalon.jpg" width="80" height="80"> <br> <input type="checkbox" value="jars" name="jars"><img src="jars.jpg" width="80" height="80"> <input type="checkbox" value="lapin" name="lapin"><img src="lapin.jpg" width="80" height="80"> <input type="checkbox" value="pigeon" name="pigeon"><img src="pigeon.jpg" width="80" height="80"> <br> <input type="checkbox" value="pintade" name="pintade"><img src="pintade_male.jpg" width="80" height="80"> <input type="checkbox" value="taureau" name="taureau"><img src="taureau.jpg" width="80" height="80"> <input type="checkbox" value="verrat" name="verrat"><img src="verrat.jpg" width="80" height="80"> <input type="submit" name="Envoyer"> </form>
dans une l' autre page ou je récupère mes données
sur la deuxième page, il m'affiche pas bonne réponse ou mauvaise réponse
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 echo 'Question 1 : '; $cpt=0; if (isset($_POST['checkbox'])) { if($_POST['checkbox'] == 'etalon') { echo "Bonne réponse"; $cpt++; } else{ echo "Mauvaise réponse c'était étalon";} }
Merci d'avance pour votre aide
Partager