tabatsoy Posted March 18, 2008 Share Posted March 18, 2008 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 https://forums.phpfreaks.com/topic/96696-help-me-please/ Share on other sites More sharing options...
trq Posted March 18, 2008 Share Posted March 18, 2008 And what is your problem? Link to comment https://forums.phpfreaks.com/topic/96696-help-me-please/#findComment-494803 Share on other sites More sharing options...
tabatsoy Posted March 18, 2008 Author Share Posted March 18, 2008 when someone press the submit button the browser will print out "thank you for taking the exam" and not the form Link to comment https://forums.phpfreaks.com/topic/96696-help-me-please/#findComment-494821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.