Hi! I was trying to make a survey or questionaire script but got stuck when I got there
can anyone pinpoint the mistake I am making here?
Thanks in advance!
<form action="quiz1result.php" method="POST">
<h1>Quiz I</h1>
1. Please write down the Be-Verbs.<br>
*<input type="text" name="am" value="<?php echo $am;?>">
<?php if($am =="am") {echo"Correct! The answer is: am.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: am.</font>";}?><br>
*<input type="text" name="is" value="<?php echo $is;?>">
<?php if($is == "is") {echo"Correct! The answer is: is.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: is</font>";}?><br>
*<input type="text" name="are" value="<?php echo $are;?>">
<?php if($are =="are") {echo"Correct! The answer is: are.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: are</font>";}?><br>
*<input type="text" name="was" value="<?php echo $was;?>">
<?php if($was =="was") {echo"Correct! The answer is: was.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: was</font>";}?><br>
*<input type="text" name="were" value="<?php echo $were;?>">
<?php if($were =="were") {echo"Correct! The answer is: were.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: were</font>";}?><br>
*<input type="text" name="be" value="<?php echo $be;?>">
<?php if($be =="be") {echo"Correct! The answer is: be.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: be</font>";}?><br>
<hr noshade><br>
2. Are you reading books? <br>
<textarea cols="50" rows="2" name="reading1"><?php echo $reading1;?></textarea>
<?php if($reading1 =="Yes, I am reading books.") {echo"Correct! The answer is: Yes, I am reading books.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: Yes, I am reading books.</font>";}?><br><br>
<textarea cols="50" rows="2" name="reading2"><?php echo $reading2;?></textarea>
<?php if($reading2 =="No, I am not reading books.") {echo"Correct! The answer is: No, I am not reading books.";}else{echo"<font color='red'>Sorry, Wrong answer! The answer is: No, I am not reading books.</font>";}?><br><hr noshade><br>
3. Are you reading books? Please write it in Past form.<br>
<textarea cols="50" rows="2" name="readingpast"><?php echo $readingpast;?></textarea>
<?php if($readingpast =="Were you reading books?")
{echo"Correct! The answer is: Were you reading books?";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: Were you reading books?</font>";}?>
<br><br>
<textarea cols="50" rows="2" name="readingpast1"><?php echo $readingpast1;?></textarea>
<?php if($readingpast1 =="Yes, I was reading books.")
{echo"Correct! The answer is: Yes, I was reading books.";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: Yes, I was reading books.</font>";}?>
<br><br>
<textarea cols="50" rows="2" name="readingpast2"><?php echo $readingpast2;?></textarea>
<?php if($readingpast2 =="No, I was not reading books.")
{echo"Correct! The answer is: No, I was not reading books.";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: No, I was not reading books.</font>";}?><br>
<hr noshade><br>
4. Are you reading books? Please write it in Future form.<br>
<textarea cols="50" rows="2" name="readingfuture"><?php echo $readingfuture;?></textarea>
<?php if($readingfuture =="Will you be reading books?")
{echo"Correct! The answer is: Will you be reading books?";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: Will you be reading books?</font>";}?>
<br><br>
<textarea cols="50" rows="2" name="readingfuture1"><?php echo $readingfuture1;?></textarea>
<?php if($readingfuture1 =="Yes, I will be reading books.")
{echo"Correct! The answer is: Yes, I will be reading books.";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: Yes, I will be reading books.</font>";}?>
<br><br>
<textarea cols="50" rows="2" name="readingfuture2"><?php echo $readingfuture2;?></textarea>
<?php if($readingfuture2 =="No, I will not be reading books..")
{echo"Correct! The answer is: No, I will not be reading books.";}
else
{echo"<font color='red'>Sorry, Wrong answer! The answer is: No, I will not be reading books.</font>";}?><br>
<hr noshade><br>
5. Please correct the sentences and questions into correct form.<br>
I <?php
$hh = $_POST['hh'];
if($hh == "have"){
echo("<font color='black' style='text-decoration:underline;'>have</font> ");
}elseif($hh == "has"){
echo("<font color='red'> has </font>");
}else{
echo("<font color='red'>_____</font>");
}
?> to study because I want to become a high school <?php
$ss = $_POST['ss'];
Bookmarks