avec se schéma laba comment je fais ? je mets en place ma page comment? les 2 zones d'editions le bouton valider etc???
<html>
<head>
<title>Quiz</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>
<form action="correction.php">
<center>
<h1>Quiz</h1></center>
<p></p><?php
$quizz= array(
array("Question 1 : Quel dossier de votre Bureau ne peut pas être effacé ?","Poste de Travail","Corbeille" ,"Mes Documents" ,"Favoris Réseau" ,"2", "Commentaire : "),
array("Question 2 : Quel est le meilleur OS ?","Windows","Linux" ,"Mac" ,"Chrome OS" ,"2" ,"Commentaire :"),
);
include("correction.php");
?>
</form>
</body>
</html>
<form action="page2.php">
<?php
nom(value=$_POST['nom']);
prenom(value=$_POST['prenom']);
?>
<?php $page = basename($_SERVER['PHP_SELF']);
error_reporting(E_ALL ^ E_NOTICE);
if (!$_POST['result']) {
print "<form action=\"$page\" method='post'>\n";
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 type='submit' style='background-color:#f66' onmouseover=\"this.style.color='#fff'\" onmouseout=\"this.style.color='#000'\" onmousedown=\"this.style.color='#f90'\" value='Vos résultats et la correction' /></center></form>\n";
}
else {
print '<h4 align="center">Résultats du quiz</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 "La bonne réponse est <b>".$bonne."</b> mais vous ";
if ($reponse=="") {
print "n'avez rien répondu.";
}
else {
print 'avez choisi la proposition" <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 $points bonne";
if ($points>1) print "s";
print " réponse";
if ($points>1) print "s";
print " sur ".count($quizz)." questions.</h4>\n";
}
}
?>
</form>
Par contre je ne vois pas ou mettre le point (value = $point)<?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('X', 'note du quizz [Info De Base]', "$nom $prenom a obtenu la note de $points", $headers)
?>
Si tu peux m'aider maintenant si il manque des choses ..
c'etait schematique les nom(value=$_POST['nom'])Apparement il y a un pb d'écriture pour sa : nom(value=$_POST['nom']);
J'obtiens ce mess d'erreur : Parse error: syntax error, unexpected '=' in C:\Program Files\......correction.php on line 3
Si tu peux m'aider j'espère que je n'ai pas refait ces fichiers dans le vent ^^
en gros a un <input type="text" name="nom" value="<?php echo $_POST['nom'] ?>" />a ok
nom(value=$_POST['nom']); ba sa signifie quoi par rapport à mon code précédent?
<html>
<head>
<title>Quiz</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>
<form action="correction.php">
<center>
<h1>Quiz</h1></center>
<input type="text" name="nom" value="<?php echo $_POST['nom'] ?>" />
<input type="text" name="prenom" value="<?php echo $_POST['prenom'] ?>" />
<p></p><?php
$quizz= array(
array("Question 1 : Quel dossier de votre Bureau ne peut pas être effacé ?","Poste de Travail","Corbeille" ,"Mes Documents" ,"Favoris Réseau" ,"2", "Commentaire : "),
array("Question 2 : Quel est le meilleur OS ?","Windows","Linux" ,"Mac" ,"Chrome OS" ,"2" ,"Commentaire :"),
);
include("correction.php");
?>
<input type="hidden" name="points" value="<?php echo $points ?>" />
</form>
</body>
</html>
<form action="page2.php">
<?php
nom(value=$_POST['nom']);
prenom(value=$_POST['prenom']);
?>
<?php $page = basename($_SERVER['PHP_SELF']);
error_reporting(E_ALL ^ E_NOTICE);
if (!$_POST['result']) {
print "<form action=\"$page\" method='post'>\n";
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 type='submit' style='background-color:#f66' onmouseover=\"this.style.color='#fff'\" onmouseout=\"this.style.color='#000'\" onmousedown=\"this.style.color='#f90'\" value='Vos résultats et la correction' /></center></form>\n";
}
else {
print '<h4 align="center">Résultats du quiz</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 "La bonne réponse est <b>".$bonne."</b> mais vous ";
if ($reponse=="") {
print "n'avez rien répondu.";
}
else {
print 'avez choisi la proposition" <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 $points bonne";
if ($points>1) print "s";
print " réponse";
if ($points>1) print "s";
print " sur ".count($quizz)." questions.</h4>\n";
}
}
?>
<input type="hidden" name="points" value="<?php echo $points ?>" />
</form>
<?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('X', 'note du quizz [Info De Base]', "$nom $prenom a obtenu la note de $points", $headers)
?>