bon j'ai pa changé grand chose, surtout un peu aérée ton code
infobase
<html>
<head>
<title>Quiz Info de base</title>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #ffffff;
font-size: 11px;
color: #000000;
margin-top: 0;
margin-left: 0;
padding:0;
}
p, ul, ol, td {
text-align: justify;
}
.orange {
color: #ff6600;
background-color: transparent;
font-weight: bold;
-->
</style>
</head>
<body>
<button onclick="history.go(-1)" style="background-color:#f66" onmouseover="this.style.color='#fff'" onmouseout="this.style.color='#000'" onmousedown="this.style.color='#f90'">Retour</button>
<center>
<h1>INITIATION : INFO DE BASE</h1>
</center>
<?php
$quizz= array(
array("<u>Question 1</u> : Quel dossier de votre Bureau ne peut pas être effacé ?","Poste de Travail","Corbeille","Mes Documents","Favoris Réseau","2","<u>Commentaire</u> : La corbeille est le seul dossier du Bureau qui ne peut pas être effacé ni même renommé."),
array("<u>Question 2</u> : Quel est le meilleur OS ?","Windows","Linux","Mac","Chrome OS","2","<u>Commentaire</u> : Linux est de loin le meilleur OS, le Pingouin gagne toujours devant Apple et Windows. Quant à Chrome OS, il n'est pas encore ouvert grand public."),
);
include("infodebasecorrection.php");
?>
</body>
</html>
infobasecorrection
<script type="text/javascript">
function controle(form1)
{
var nom = document.form1.nom.value;
var prenom = document.form1.prenom.value;
if(( form1.nom.value == "") || ( form1.prenom.value == ""))
{
alert('Veuillez rentrer votre NOM ET PRENOM !!!');
}
else
{
alert("Bonjour " + nom + " " + prenom + ". " + "Vous avez choisis l'initiation Info De Base" );
}
}
</script>
<?php
if (!isset($_POST['result']))
{
print "<form id=\"form1\" action=\"{$_SERVER['PHP_SELF']}\" method='post'>\n";
print '<center><label> Nom : <input type=text name="nom"></label>';
print '<label> Prénom : <input type=text name="prenom"></label></center><br /><br />';
for ($i=0; $i<count($quizz); $i++)
{
print '<blockquote><span class="orange">';
print "\t".$quizz[$i][0]."\n";
print '</span><br /><br />';
for ($j=1; $j<count($quizz[$i])-2; $j++)
{
$quest=$quizz[$i][$j];
print "<input type='radio' name=\"$i\" value=\"$j\" /> $quest<br />\n ";
}
print "</blockquote><hr />";
}
print "<input type='hidden' name='result' value='voir' /><br />\n<center>";
print "<input onclick='controle(form1)' type='submit' style='background-color:#f66' onmouseover=\"this.style.color='#fff'\" onmouseout=\"this.style.color='#000'\" onmousedown=\"this.style.color='#f90'\" value='VALIDER' /></center></form>\n";
}
else
{
print "<form action=\"page2.php\" method='post'>\n";
print '<h4 align="center">INITIATION : INFO DE BASE : CORRECTION</h4><br />';
$points=0;
for($i=0; $i<count($quizz); $i++)
{
$reponse = trim($_POST[$i]);
print '<blockquote><span class="orange">';
print "\t".$quizz[$i][0]."</span><br /><br />\n";
$numero_bonne=$quizz[$i][count($quizz[$i])-2]; // avant dernière valeur du tableau
$bonne=$quizz[$i][$numero_bonne]; // Bonne réponse
if ($reponse==$numero_bonne)
{
print "Votre réponse <b><i>".$bonne."</i></b> est exacte.";
$points++;
}
else
{
print "<u>Réponse</u> : La bonne réponse est <b>".$bonne."</b> mais vous ";
if ($reponse=="")
{
print "n'avez rien répondu.";
}
else
{
print 'avez répondu" <b>'.$quizz[$i][$reponse].' "</b>.';
}
}
$commentaire=$quizz[$i][count($quizz[$i])-1]; // dernière valeur du tableau
print "<br />".$commentaire."<br />\n";
print "</blockquote><hr />\n";
}
if($points==count($quizz))
{
print"<br /><h4 align='center'>Félicitations vous avez tout juste!</h4>\n";
}
else
{
print "<br /><h4 align='center'>Vous avez la note de $points";
if ($points>1) print "s";
print " sur ".count($quizz)."</h4>\n";
}
print "<input type=\"hidden\" name=\"nom\" value=\"{$_POST['nom']}\" />";
print "<input type=\"hidden\" name=\"prenom\" value=\"{$_POST['prenom']}\" />";
print "<input type=\"hidden\" name=\"points\" value=\"$points\" />";
print '<button type="submit">Envoyer</button>';
print "</form>";
}
?>
page2
<?php
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$points = $_POST['points'];
$headers ='From: "cyber quizz"<[email protected]>'."\n";
$headers .='Reply-To: [email protected]'."\n";
$headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';
$mail = mail('tonmail', 'note du quizz [Info De Base]', "$nom $prenom a obtenu la note de $points", $headers);
if($mail)
{
echo 'mail envoyé';
}
else
{
echo 'erreur mail';
}
?>
bon j'ai pa changé grand chose, surtout un peu aérée ton code
infobase
[php]<html>
<head>
<title>Quiz Info de base</title>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #ffffff;
font-size: 11px;
color: #000000;
margin-top: 0;
margin-left: 0;
padding:0;
}
p, ul, ol, td {
text-align: justify;
}
.orange {
color: #ff6600;
background-color: transparent;
font-weight: bold;
-->
</style>
</head>
<body>
<button onclick="history.go(-1)" style="background-color:#f66" onmouseover="this.style.color='#fff'" onmouseout="this.style.color='#000'" onmousedown="this.style.color='#f90'">Retour</button>
<center>
<h1>INITIATION : INFO DE BASE</h1>
</center>
<?php
$quizz= array(
array("<u>Question 1</u> : Quel dossier de votre Bureau ne peut pas être effacé ?","Poste de Travail","Corbeille","Mes Documents","Favoris Réseau","2","<u>Commentaire</u> : La corbeille est le seul dossier du Bureau qui ne peut pas être effacé ni même renommé."),
array("<u>Question 2</u> : Quel est le meilleur OS ?","Windows","Linux","Mac","Chrome OS","2","<u>Commentaire</u> : Linux est de loin le meilleur OS, le Pingouin gagne toujours devant Apple et Windows. Quant à Chrome OS, il n'est pas encore ouvert grand public."),
);
include("infodebasecorrection.php");
?>
</body>
</html>[/php]
infobasecorrection
[php] <script type="text/javascript">
function controle(form1)
{
var nom = document.form1.nom.value;
var prenom = document.form1.prenom.value;
if(( form1.nom.value == "") || ( form1.prenom.value == ""))
{
alert('Veuillez rentrer votre NOM ET PRENOM !!!');
}
else
{
alert("Bonjour " + nom + " " + prenom + ". " + "Vous avez choisis l'initiation Info De Base" );
}
}
</script>
<?php
if (!isset($_POST['result']))
{
print "<form id=\"form1\" action=\"{$_SERVER['PHP_SELF']}\" method='post'>\n";
print '<center><label> Nom : <input type=text name="nom"></label>';
print '<label> Prénom : <input type=text name="prenom"></label></center><br /><br />';
for ($i=0; $i<count($quizz); $i++)
{
print '<blockquote><span class="orange">';
print "\t".$quizz[$i][0]."\n";
print '</span><br /><br />';
for ($j=1; $j<count($quizz[$i])-2; $j++)
{
$quest=$quizz[$i][$j];
print "<input type='radio' name=\"$i\" value=\"$j\" /> $quest<br />\n ";
}
print "</blockquote><hr />";
}
print "<input type='hidden' name='result' value='voir' /><br />\n<center>";
print "<input onclick='controle(form1)' type='submit' style='background-color:#f66' onmouseover=\"this.style.color='#fff'\" onmouseout=\"this.style.color='#000'\" onmousedown=\"this.style.color='#f90'\" value='VALIDER' /></center></form>\n";
}
else
{
print "<form action=\"page2.php\" method='post'>\n";
print '<h4 align="center">INITIATION : INFO DE BASE : CORRECTION</h4><br />';
$points=0;
for($i=0; $i<count($quizz); $i++)
{
$reponse = trim($_POST[$i]);
print '<blockquote><span class="orange">';
print "\t".$quizz[$i][0]."</span><br /><br />\n";
$numero_bonne=$quizz[$i][count($quizz[$i])-2]; // avant dernière valeur du tableau
$bonne=$quizz[$i][$numero_bonne]; // Bonne réponse
if ($reponse==$numero_bonne)
{
print "Votre réponse <b><i>".$bonne."</i></b> est exacte.";
$points++;
}
else
{
print "<u>Réponse</u> : La bonne réponse est <b>".$bonne."</b> mais vous ";
if ($reponse=="")
{
print "n'avez rien répondu.";
}
else
{
print 'avez répondu" <b>'.$quizz[$i][$reponse].' "</b>.';
}
}
$commentaire=$quizz[$i][count($quizz[$i])-1]; // dernière valeur du tableau
print "<br />".$commentaire."<br />\n";
print "</blockquote><hr />\n";
}
if($points==count($quizz))
{
print"<br /><h4 align='center'>Félicitations vous avez tout juste!</h4>\n";
}
else
{
print "<br /><h4 align='center'>Vous avez la note de $points";
if ($points>1) print "s";
print " sur ".count($quizz)."</h4>\n";
}
print "<input type=\"hidden\" name=\"nom\" value=\"{$_POST['nom']}\" />";
print "<input type=\"hidden\" name=\"prenom\" value=\"{$_POST['prenom']}\" />";
print "<input type=\"hidden\" name=\"points\" value=\"$points\" />";
print '<button type="submit">Envoyer</button>';
print "</form>";
}
?>[/php]
page2
[php]<?php
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$points = $_POST['points'];
$headers ='From: "cyber quizz"<
[email protected]>'."\n";
$headers .='Reply-To:
[email protected]'."\n";
$headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';
$mail = mail('tonmail', 'note du quizz [Info De Base]', "$nom $prenom a obtenu la note de $points", $headers);
if($mail)
{
echo 'mail envoyé';
}
else
{
echo 'erreur mail';
}
?>[/php]