php textarea need help!?

lord unforgiven

New member
ok for computer class at school we have had to make a form which i have done in html. and in php we have to make it calculate how many answers are right.

But one of the questions is a textarea (Q5) which ask's you to list 5 things.
Now as i have coded it atm if you do not list them in the right oarder it will be wrong. But i was told there is a code so that it can be listed in any oarder

can anyone help please? my php page is


$drummer=($_POST["drummer"]);
$album= ($_POST["album"]);
$name = stripslashes($_POST["fname"]);
$grammy= stripslashes ($_POST["grammy"]);
$grammy= trim($grammy);
$song= stripslashes ($_POST["3song"]);
$song= trim($song);
$sname= stripslashes ($_POST["sname"]);
$comment = $_POST["comments"];
$releases= strtolower($_POST["releases"]);
$releases= stripslashes($releases);
$releases= trim($releases);


$total= 0;
echo "<p> <b> ";
echo "<h3>" ;
echo $name;
echo " ";
echo $sname;
echo "</br>";
echo $grammy;
echo "</br>";


if ($drummer= yes) {
echo " Q1 is correct";
$total= $total +1;
} else {
$total= $total;
echo "Q1 is incorrect";
}
echo "</br>";
echo "</br>";

if ($album= no) {
echo " Q2 is correct";
$total= $total +1;
} else {
$total= $total;
echo "Q2 is incorrect";
}
echo "</br>";
echo "</br>";

if ($song== eyeless) {
echo "Q3 is correct" ;
$total= $total +1;
}else{
$total= $total;
echo "Q3 is incorrect";
}
echo "</br>";
echo "</br>";

if ($grammy== "before i forget") {
echo "Q4 is correct" ;
$total= $total+1;
}else{
$total= $total;
echo "Q4 is incorrect";
}
echo "</br>";
echo "</br>";

if ($releases== "2000 self titled, 2002 iowa, 2004 mfkr, 2006 vol3 (the subliminal verses), 2008 all hope is gone") {
echo "Q5 is correct";
$total= $total +1;
}else{
$total= $total;
echo "Q5 is incorrect";
}
echo "</br>";
echo "</br>";
echo "you got " ;
echo $total ;
echo " out of 5";
echo "</h3>";

if($total== 1) {
echo "you got 20% correct, you might need to work harder";
}

if($total== 2) {
echo "you got 40% correct, you might need to work harder";
}

if($total== 3) {
echo "you got 60% correct, you passed but you might need to work harder";
}

if($total== 4) {
echo "you got 80% correct, good work";
}

if($total== 5) {
echo "you got 100% correct, great work";
echo "<h1>";
echo " your a genius";
echo "</h1>";
}
 
Back
Top