<html> <head> <title>ThaiCreate.Com PHP & SQL Server Tutorial</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head> <body> <form action="insertadd.php" name="frmAdd" method="post"> <table width="600" border="1"> <tr> <th width="91"> <div align="center">name</div></th> <th width="160"> <div align="center">id </div></th> <th width="198"> <div align="center">Lname</div></th> <th width="97"> <div align="center">Sex</div></th> <th width="70"> <div align="center"> <p>Addr1 </p> </div></th> <th width="70"> <div align="center">District</div></th> </tr> <tr> <td><div align="center"> <input type="text" name="FName" size="20" id="FName"> </div></td> <td><input type="text" name="IDCard" size="13" id="IDCard"></td> <td><input type="text" name="LName" size="20" id="LName"></td> <td><div align="center"><input type="text" name="Sex" size="5" id="Sex"></div></td> <td align="right"><input type="text" name="Addr1" size="5" id="Addr1"></td> <td align="right"><input type="text" name="District" size="5" id="District"></td> </tr> </table> <input type="submit" name="submit" value="submit"> </form> </body> </html>
<html> <head> <title>ThaiCreate.Com PHP & SQL Server Tutorial</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head> <body> <? include("config.inc.php"); $strSQL = "INSERT INTO Applicant "; $strSQL .="(IDCard,FName,LName,Sex,Addr1,District) "; $strSQL .="VALUES "; $strSQL .="('".$_POST["IDCard"]."','".$_POST["FName"]."','".$_POST["LName"]."' "; $strSQL .=",'".$_POST["Sex"]."','".$_POST["Addr1"]."','".$_POST["District"]."') "; $objQuery = mssql_query($strSQL); if($objQuery) { echo "Save Done."; } else { echo "Error Save [".$strSQL."]"; } mssql_close($objConnect); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง