<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>:: Test ::</title> <link href="css/Style02.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="containner"> <div id="main"> <div id="label_top"><img src="img/label_top.png" /> </div> <div id="bg_test"> <div id="border_text"> <form action="testcheck.php" method="post" enctype="multipart/form-data" name="subcheck"> <? include 'connect.php'; $viewTestBefore = "SELECT * FROM tb_testbefore order by rand() limit 10"; $objQuery = mysql_query($viewTestBefore); $i=0; //$j=0; while($objResult=mysql_fetch_array($objQuery)) { $i++; $j++; ?> <table width="570" border="0" align="left"> <tr> <td width="30"><b>ข้อ <?=$j;?></b></td> <td colspan="4"><b> <input name="id<?=$i;?>" type="hidden" value="<?=$objResult["id_tbefore"];?>"> <?=$objResult["question_tbefore"];?></b> </td> </tr> <tr> <td width="50"></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="1" checked></td> <td width="200"><?=$objResult["choice1_tbefore"];?></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="2"></td> <td width="200"><?=$objResult["choice2_tbefore"];?></td> </tr> <tr> <td width="50"></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="3"></td> <td width="200"><?=$objResult["choice3_tbefore"];?></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="4"></td> <td width="200"><?=$objResult["choice4_tbefore"];?> <input name="ans<?=$i;?>" type="hidden" value="<?=$objResult["answer_tbefore"];?>"> </td> </tr> <tr><td colspan="5"> </td></tr> </table> <? } mysql_close($objConnect); ?> <input type="hidden" name="line" value="<?=$i;?>"> <div id="border_buttun"> <div id="text_check"><img src="img/text_check.png" /></div> <div class="b_check"><a href="javascript:document.subcheck.submit()"><img src="img/b_check.png" /></a></div> <div class="b_check"><a href="javascript:document.subcheck.reset()"><img src="img/b_check1.png" /></a></div> </div> </form> </div> </div> </div> </div> </div> </body> </html>
<? $score=0; $check = $_POST["c$i"]; $c_answer = $_POST["ans$i"]; $c_line = $_POST["line"]; echo "$check<br>"; echo "$c_answer<br>"; echo "$i<br>"; echo "$c_line<br>"; for($s=1;$s<=$c_line;$s++) { if($check == $c_answer) { $score=$score+1; } } echo "True $score<br>"; ?>
<? $score=0; $c_line = $_POST["line"]; echo "$check<br>"; echo "$c_answer<br>"; echo "$i<br>"; echo "$c_line<br>"; for($s=1;$s<=$c_line;$s++) { $check = $_POST["c$i"]; $c_answer = $_POST["ans$i"]; if($check == $c_answer) { $score=$score+1; } } echo "True $score<br>"; ?>
<div id="border_text"> <form action="testcheck.php" method="post" enctype="multipart/form-data" name="subcheck"> <? include 'connect.php'; $viewTestBefore = "SELECT * FROM tb_testbefore order by rand() limit 10"; $objQuery = mysql_query($viewTestBefore); $i=0; $j=0; while($objResult=mysql_fetch_array($objQuery)) { $i++; $j++; ?> <table width="570" border="0" align="left"> <tr> <td width="30"><b>ข้อ <?=$j;?></b></td> <td colspan="4"><b> <input name="id<?=$i;?>" type="hidden" value="<?=$objResult["id_tbefore"];?>"> <?=$objResult["question_tbefore"];?></b> </td> </tr> <tr> <td width="50"></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="1" checked></td> <td width="200"><?=$objResult["choice1_tbefore"];?></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="2"></td> <td width="200"><?=$objResult["choice2_tbefore"];?></td> </tr> <tr> <td width="50"></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="3"></td> <td width="200"><?=$objResult["choice3_tbefore"];?></td> <td width="10" align="center"> <input type="radio" name="c<?=$i;?>" value="4"></td> <td width="200"><?=$objResult["choice4_tbefore"];?> <input name="ans<?=$i;?>" type="hidden" value="<?=$objResult["answer_tbefore"];?>"> </td> </tr> <tr><td colspan="5"> </td></tr> </table> <? } mysql_close($objConnect); ?> <input type="hidden" name="line" value="<?=$i;?>"> <div id="border_buttun"> <div id="text_check"><img src="img/text_check.png" /></div> <div class="b_check"><a href="javascript:document.subcheck.submit()"><img src="img/b_check.png" /></a></div> <div class="b_check"><a href="javascript:document.subcheck.reset()"><img src="img/b_check1.png" /></a></div> </div> </form> </div>
<?PHP $score=0; $c_line = $_POST["line"]; //echo "$c_line<br>"; echo "ค่า c_line :: ".$c_line."<br>"; for($s=1;$s<=$c_line;$s++) { $check = $_POST["c$s"]; echo "ค่าcheck :: ".$check."<br>"; $c_answer = $_POST["ans$s"]; echo "ค่าanswer :: ".$c_answer."<br>"; if($check == $c_answer) { $score=$score+1; } } echo "True $score<br>"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง