<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <script type="text/javascript"> function sSelected(){ index = document.getElementById('province').selectedIndex; selected_text = document.getElementById('province').options[index].text; document.getElementById('sProvince').value = selected_text; } </script> <body> <form name="frmMain" action="" method="post"> <script language="JavaScript"> function fncSum() { if(isNaN(document.frmMain.txtNumberB.value) || document.frmMain.txtNumberB.value == "") { alert('(Number B)Please input Number only.'); document.frmMain.txtNumberB.focus(); return; } document.frmMain.txtNumberC.value = parseFloat(document.frmMain.sProvince.value) * parseFloat(document.frmMain.txtNumberB.value); } </script> <form action="file:///C|/AppServ/www/testmultisave.php" name="frmAdd" method="post"> <select id="province" name="province" onChange="sSelected()"> <option value="0">กรุณาเลือก</option> <option value="1" name="1" >2000</option> <option value="2" name="2">3000</option> <option value="3" name="3">4000</option> </select> <br> A<input type="text" id="sProvince" name="txtNumberA" value="" /> <br> B<input type="text" name="txtNumberB" value=""> <br> C<input type="text" name="txtNumberC" value=""><br> <input type="button" name="btnSum" value="คำนวณ" OnClick="fncSum();"> <center><input type="submit" name="submit" value="ส่งข้อมูล"></center> </form> </body> </html>
<html> <head> <title></title> </head> <body bgcolor=#FFCC66 > <center> <?php $objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database"); $objDB = mysql_select_db("test"); mysql_query("SET character_set_results=tis620"); mysql_query("SET character_set_client=tis620"); mysql_query("SET character_set_connection=tis620"); $strSQL = "INSERT INTO test "; $strSQL .="(numberA,numberB,numberC) "; $strSQL .="VALUES "; $strSQL .="('".$_POST["txtNumberA"]."','".$_POST["txtNumberB"]."','".$_POST["txtNumberC"]."') "; $objQuery = mysql_query($strSQL); if($objQuery) { echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=testmultishow.php\">"; } else { echo "ผิดพลาด ข้อมูลไม่ถูกต้อง หรือ มีรายละเอัยดซ้ำกัน"; } mysql_close($objConnect); ?> </center> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง