<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body,td,th { font-family: Tahoma; font-size: 12px; color: #000000; } --> </style> </head> <form action="save_menuinsertAnswer.php" method="post"> <table width="310" height="82" border="0"> <tr> <td width="304" height="24" bgcolor="#FFFFFF"> <form id="form1" name="form1" method="post" action=""> <label></label> <table width="529" height="130" border="0" bgcolor="#FFCC00"> <tr> <td height="20" colspan="2" bgcolor="#FF3300">3. กรอกข้อมูลคำตอบ</td> </tr> <tr> <td width="118" bgcolor="#FFCC00"> </td> <td width="401" height="20" bgcolor="#FFCC00">กรุณาเลือกตอน <select name="now_id" id="now_id"onchange="location.href='page_inserteva.php?now_id='+this.value;" style="width:200px"> <option value="">กรุณาเลือกตอน</option> <? $host="localhost"; $user="root"; $password="1234"; $dbname="ebandit"; $connection=mysql_connect($host,$user,$password) or die("เชื่อมต่อฐานข้อมูลไม่ได้"); mysql_select_db($dbname) or die("ไม่สามารถเลือกฐานข้อมูลได้"); $sql="select * from now order by now_id ASC"; $dbquery=mysql_db_query($dbname,$sql); while($result=mysql_fetch_array($dbquery)){ if($now_id == $result[now_id]){ //เพื่อให้ แสดง $cat_id ที่ส่งค่ามาให้ ?> <option value="<?=$result[now_id];?>" selected="selected"> <?=$result[now_id];?> </option> <? }else{?> <option value="<?=$result[now_id];?>"> <?=$result[now_id];?> </option> <? } } ?> </select></td> </tr> <tr> <td bgcolor="#FFCC00"> </td> <td height="26" bgcolor="#FFCC00">กรุณาเลือกข้อคำถาม <select name="q_id" id="q_id" style="width:200px"> <option value="">กรุณาเลือกข้อคำถาม</option> <? if($now_id != ""){ //กรณีที่ มี่คา caat_id ส่งมาให้ทำงาน $host="localhost"; $user="root"; $password="1234"; $dbname="ebandit"; $connection=mysql_connect($host,$user,$password) or die("เชื่อมต่อฐานข้อมูลไม่ได้"); mysql_select_db($dbname) or die("ไม่สามารถเลือกฐานข้อมูลได้"); $sql_sub="select * from question where now_id = '$now_id' "; $dbquery_sub = mysql_db_query($dbname, $sql_sub); while($result_sub=mysql_fetch_array($dbquery_sub)){ ?> <option value="<?=$result_sub[q_id];?>"> <?=$result_sub[q];?> </option> <? }} ?> </select></td> </tr> <tr> <td bgcolor="#FFCC00"> </td> <td height="26" bgcolor="#FFCC00">เลือกจำนวนข้อคำตอบ <label> <select name="a" id="a"> <option>จำนวนข้อคำตอบ</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </label> <input type="submit" name="button2" id="button2" value="Submit" /></td> </tr> <tr> <td bgcolor="#FFCC00"> </td> <td height="26" bgcolor="#FFCC00">ใส่ข้อมูล <?php $a=; for($i=1;$i<=$a;$i++) { ?> <input name="" type="text" /> <? } ?></td> </tr> </table> </form> </body> </html>
<script language='javascript'> function enable_other(){ var sel = document.getElementById('sel_work').options[document.getElementById('sel_work').selectedIndex].value; if(sel == 1){ document.getElementById('one').style.display="inline"; document.getElementById('two').style.display="none"; document.getElementById('three').style.display="none"; }else if(sel == 2){ document.getElementById('two').style.display="inline"; document.getElementById('one').style.display="none"; document.getElementById('three').style.display="none"; }else if(sel == 3){ document.getElementById('three').style.display="inline"; document.getElementById('one').style.display="none"; document.getElementById('two').style.display="none"; }else{ document.getElementById('one').style.display="none"; document.getElementById('two').style.display="none"; document.getElementById('three').style.display="none"; } } </script> <select id='sel_work' name='sel_work' onchange='enable_other();'> <option value='0'>จำนวนข้อสอบ</option> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> <div id='one' style='display:none;'> <br><input type='text' name='txtone1' id='txtone1' value='' > </div> <div id='two' style='display:none;'> <br><input type='text' name='txttwo1' id='txtotwo1' value='' > <br><input type='text' name='txttwo1' id='txtotwo1' value='' > </div> <div id='three' style='display:none;'> <br><input type='text' name='txtthree1' id='txtotwo1' value='' > <br><input type='text' name='txtthree2' id='txtotwo2' value='' > <br><input type='text' name='txtthree3' id='txtotwo3' value='' > </div>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง