affichage sur une autre page?
Posté : 16 avr. 2016, 17:39
bonjour,
comment afficher les résultat sur une autre page.
car de cette manière rien a faire.
comment afficher les résultat sur une autre page.
car de cette manière rien a faire.
<form class="form_exercices_ou_result" action="result_ou_1.php" method="POST" />
<div class="blc_pronom">
<?php
$reponses = array(
'chx' => array(
'reponse' => 'une',
'mot' => 'route'
) ,
'chx_1' => array(
'reponse' => 'un',
'mot' => 'four'
) ,
'chx_2' => array(
'reponse' => 'un',
'mot' => 'bouton'
) ,
'chx_3' => array(
'reponse' => 'un',
'mot' => 'jour'
) ,
'chx_4' => array(
'reponse' => 'une',
'mot' => 'poubelle'
) ,
'chx_5' => array(
'reponse' => 'un',
'mot' => 'nouveau'
) ,
'chx_6' => array(
'reponse' => 'un',
'mot' => 'trou'
) ,
'chx_7' => array(
'reponse' => 'une',
'mot' => 'nouvelle'
) ,
'chx_8' => array(
'reponse' => 'un',
'mot' => 'tournevis'
) ,
'chx_9' => array(
'reponse' => 'une',
'mot' => 'douche'
) ,
);
foreach($reponses as $cle => $reponse)
{
$choix = array(
'un' => 'un',
'une' => 'une'
);
foreach($choix as $key => $value_choix)
{
echo '<p><input type="checkbox" name="' . $cle . '" value="' . $value_choix . '" />' . $key . '</p>';
}
echo '<p></p><p><b>' . $reponse['mot'] . '</b></p><br />';
if (isset($_POST['correction']))
{
// print_r($_POST['correction']);
$cle = $_POST[$cle];
if (empty($cle))
{
$msg = '<p>veuillez remplir tous les champs</p>';
echo $msg;
}
else
if ($cle == $reponse['reponse'])
{
echo '<p>'.$reponse['reponse'].'</p>';
}else if($cle !== $reponse['reponse']){
echo '<p style="color:red;">'.$reponse['reponse'].'</p>';
}
}
}
?>
</div>
<p class="correction_center"><input type="submit" name="correction" value="correction"/></p>
</form>