Jump to content

Help me Please!!!


tabatsoy

Recommended Posts

Good day Masters of the Universe!!!

    here is my code:

<?
$db = mysql_connect("localhost");
mysql_select_db("examination",$db); 


echo '<FORM name ="form1" method ="post" action ="dummy2.php">
<table width="800" border="0"  align="center" class="underresult">';

	$query = "SELECT *
			FROM logicQuestions";
	$result = mysql_query($query);
	for($i = 0; $i < mysql_num_rows($result); $i++){
		$question_number_logic ++;
		$question = mysql_result($result, $i, "question");
		$choiceA = mysql_result($result, $i, "choiceA");
		$choiceB = mysql_result($result, $i, "choiceB");
		$choiceC = mysql_result($result, $i, "choiceC");
		$choiceD = mysql_result($result, $i, "choiceD");
		$answer = mysql_result($result, $i, "answer");
		echo '<tr>
				<td></td>';
			'</tr>';
		echo '<tr>
				<td> </td>';
			'</tr>';

		echo '<tr>
				<td width = "20" align = "left" valign = "top"><font class = "questions">'.$question_number_logic.'.</span><td>';
				echo '<td width = "280" align = "left" valign = "top" ><font class = "questions">'.$question.'</span></td>';		
				echo '<td width = "125" align = "left" valign = "center" > </td>';
				echo '<td width = "125" align = "left" valign = "center" > </td>';
				echo '<td width = "125"align = "left" valign = "center" > </td>';
				echo '<td width = "125" align = "left" valign = "center" > </td></tr>';

		echo '<tr>
				<td> </td>';
			'</tr>';


		echo '<tr>
				<td width = "20" align = "left" valign = "top"><td>';
				echo '<td width = "280" align = "left" valign = "center" > </td>';		
				echo '<td width = "125" align = "left" valign = "center" ><font class = "style1"><input name="'.$question_number_logic.'" type="radio" value="'.$choiceA.'" />'.$choiceA.'</span></td>';
				echo '<td width = "125" align = "left" valign = "center" ><font class = "style1"><input name="'.$question_number_logic.'" type="radio" value="'.$choiceB.'" />'.$choiceB.'</span></td>';
				echo '<td width = "125"align = "left" valign = "center" ><font class = "style1"><input name="'.$question_number_logic.'" type="radio" value="'.$choiceC.'" />'.$choiceC.'</span></td>';
				echo '<td width = "125" align = "left" valign = "center" ><font class = "style1"><input name="'.$question_number_logic.'" type="radio" value="'.$choiceD.'" />'.$choiceD.'</span></td></tr>';

		echo '<tr>
				<td colspan = "7" class = "exam">
 </td>
			</tr>';
			$selected_radio = $_POST[$question_number_logic];
if ($selected_radio == $answer) {
	$score ++;
}
}
		'</table>
<br /><br />';
echo '<table width="240" border="0" align="center" class="session">
  <tr>';
$result = mysql_query("update dummy set score = '".$score."'
					where firstname = 'joseph'");

echo '<Input type = "Submit" Name = "Submit" VALUE = "Submit">
  </tr>
</FORM>';
?>

 

all i want is When i pressed the submit button the browser will print "Thanks for taking the exam".

please help thanks in advance

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.