Dans un formulaire, j'ai des checkbox. Sur l'action du formulaire (bouton submit) je souhaite récupérer les valeurs de mes checkbox mais il ne me les reconnaît pas. Je suis en création /modification sur le formulaire.

voici mon code :

du formulaire
Code : 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
 
<form name="affiche" method="post" action="enregistrer.php" onsubmit="return verification_enregistrer();"> 
<?php
	if ($livre == 1){
		print("<td width='23%'><input type='checkbox' name='livre' value='1' checked>&nbsp;&nbsp;livre</td>");	
	} else {
		print("<td width='23%'><input type='checkbox' name='livre' value='0'>&nbsp;&nbsp;livre</td>");	
	}
	if ($photocop == 1){
		print("<td width='23%'><input type='checkbox' name='photocop' value='1' checked>&nbsp;&nbsp;photocopie</td>");	
	} else {
		print("<td width='23%'><input type='checkbox' name='photocop' value='0'>&nbsp;&nbsp;photocopie</td>");	
	}
	if ($video == 1){
		print("<td width='23%'><input type='checkbox' name='video' value='1' checked>&nbsp;&nbsp;vidéo</td>");	
	} else {
		print("<td width='23%'><input type='checkbox' name='video' value='0'>&nbsp;&nbsp;vidéo</td>");	
	}
 
	print("<td align='center' valign='center'><input type='submit' name='enregistrer' value='Enregistrer'></td>");
?>
et du enregistrer.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
<?php 
session_start(); 
$dat = date("Y/m/d");
 
//on récupère les varibles du POST du formulaire
$livre = $_POST['livre'];
$photocop = $_POST['photocop'];
$video = $_POST['video'];
dans enregistrer.php, les variables $livre, $photocop et $video ne sont pas connues ???

Merci de votre aide.