<!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"> <!-- .style10 {color: #0000FF} .style21 {font-family: Tahoma; font-size: 14px; } .style23 {font-family: Tahoma; font-weight: bold; font-size: 14px; color: #333333; } .style29 {font-size: 10px} .style36 {color: #FFFFFF} --> </style> </head> Code (PHP) [php]<?php include("connect.php") ?>
<!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"> <!-- .style10 {color: #0000FF} .style21 {font-family: Tahoma; font-size: 14px; } .style23 {font-family: Tahoma; font-weight: bold; font-size: 14px; color: #333333; } .style29 {font-size: 10px} .style36 {color: #FFFFFF} --> </style> </head> <script language="javascript"> function checkform() { //ชื่อฟอร์ม.ชื่ออุปกรณ์.value if(form1.name.value=="") { alert ('ยังไม่ได้กรอกชื่อ') ; form1.name.focus(); return false; } else if(form1.username.value=="") { alert ('ยังไม่ได้กรอก username') ; form1.username.focus(); return false; } else if(form1.pass.value=="") { alert ('ยังไม่ได้กรอก password') ; form1.pass.focus(); return false; } else if(form1.repass.value=="") //else f(form1.repass.value=="") { alert ('ยังไม่ได้ยืนยัน password') ; form1.repass.focus(); return false; } else if(form1.pass.value != form1.repass.value) { alert('ค่ารหัส password และยืนยัน password ไม่ตรงกัน') ; form1.repass.select(); return false; } else if((form1.pass.value.length < 3) || (form1.pass.value.length > 16)) { alert('รหัสผ่านต้องกรอก 4 - 16 ตัวเท่านั้น') ; form1.pass.select(); return false; } else if(form1.email.value=="") { alert ('ยังไม่ได้กรอก E-mail') ; form1.email.focus(); return false; } //if(!ereg("^.+@.+\..+$",form1.email.value)) //{ // msg("กรุณาใส่ email ให้ถูกต้อง"); //} else if(form1.email.value.indexOf('@')==-1) { alert ('กรอก e-mail ไม่ถูกต้อง') ; form1.email.focus(); return false; } } </script> <body> <br /><br /> <center> <p><img src="images/regg.jpg" width="143" height="101" /></p> <p><img src="images/0545.gif" width="406" height="16" /> </p> </center><br /> <form id="form1" name="form1" method="post" action="registerSave.php" onsubmit="return checkform();"> <table width="373" border="0" align="center" cellpadding="1" cellspacing="0" bordercolor="#99FFFF"> <tr bgcolor="#000066"> <td colspan="2" bgcolor="#0066CC"><div align="center" class="style29"> <div align="right" class="style36">ช่องที่มีเครื่องหมาย * ต้องกรอกข้อมูล </div> </div></td> </tr> <tr> <td bgcolor="#BBE9FF"><div align="left"> <span class="style23"> ชื่อ-สกุล</span></div></td> <td bgcolor="#BBE9FF"><div align="left" class="style21"> <input name="name" type="text" id="name" maxlength="40" /> <span class="style10"> *</span></div></td> </tr> <tr> <td width="159" bgcolor="#BBE9FF"><div align="left" class="style23"> Username</div></td> <td width="179" bgcolor="#BBE9FF"><div align="left" class="style21"> <input name="username" type="text" id="username" maxlength="10" /> <span class="style10"> *</span></div></td> </tr> <tr> <td bgcolor="#BBE9FF"><div align="left" class="style23"> Password</div></td> <td bgcolor="#BBE9FF"><div align="left" class="style21"> <input name="pass" type="password" id="pass" maxlength="16" /> <span class="style10"> *</span></div></td> </tr> <tr> <td height="26" bgcolor="#BBE9FF"><div align="left" class="style23"> ยืนยัน password</div></td> <td bgcolor="#BBE9FF"><div align="left" class="style21"> <input name="repass" type="password" id="repass" maxlength="16" /> <span class="style10">* </span> </div></td> </tr> <tr> <td bgcolor="#BBE9FF"><div align="left" class="style23"> e-mail</div></td> <td bgcolor="#BBE9FF"><div align="left" class="style21"> <input name="email" type="text" id="email" maxlength="30" /> <span class="style10"> * </span> </div></td> </tr> <tr bgcolor="#0066FF"> <td colspan="2" bgcolor="#0066CC"><div align="center" class="style21"> <input type="submit" name="Submit" value="ตกลง" /> <input type="reset" name="Reset" value="ยกเลิก" onclick="history.back();"/> </div></td> </tr> </table> </form> </body> </html>
if(document.getElementById('name').value=="") { alert(document.getElementById('name').value); alert ('ยังไม่ได้กรอกชื่อ') ; document.getElementById('name').focus(); return false; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง