<!doctype html> <html> <head> <meta charset="utf-8"> <title>สมัครสมาชิก</title> <link href="css/register.css" rel ="stylesheet" /> </head> <body> <table width="439" height="337" border="0" align="center"> <tr> <td width="429" height="28" colspan="4"></td> </tr> <td height="1"> <h2>ลงทะเบียนสมาชิกใหม่ / เข้าสู่ระบบ</h2> <form method="post" action="save_register.php"> <label> UserName :</label> <input id="txtUsername" type="txt" required autofocus placeholder="Username" /> <label> Password : </label> <input id="txtpassword" type="password" required placeholder="password" /> <label> ConfirmPassword : </label> <input id="txtconpassword" type="password" required placeholder="conpassword" /> <label> Email : </label> <input name="txtEmail" type="email" required placeholder="ป้อน Email" /><br/><br/> <input id ="cmdRegister" type="submit" value="Login / Register" /> </table> </body> </html>
<!doctype html> <html> <head> <meta charset="utf-8"> <title>สมัครสมาชิก</title> <link href="css/register.css" rel ="stylesheet" /> </head> <body> <? mysql_connect("localhost","root","5krarnyb2"); mysql_select_db("db_hatang"); if(trim($_POST["txtUsername"]) == "") { echo "Please input Username!"; exit(); } if(trim($_POST["txtPassword"]) == "") { echo "Please input Password!"; exit(); } if($_POST["txtPassword"] != $_POST["txtConPassword"]) { echo "Password not Match!"; exit(); } if(trim($_POST["txtName"]) == "") { echo "Please input Name!"; exit(); } $strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); if($objResult) { echo "Username already exists!"; } else { $strSQL = "INSERT INTO member (Username,Password,Email) VALUES ('".$_POST["txtUsername"]."', '".$_POST["txtPassword"]."','".$_POST["txtEmail"]."')"; $objQuery = mysql_query($strSQL); echo "Register Completed!<br>"; echo "<br> Go to <a href='login.html'>Login page</a>"; } mysql_close(); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง