<? session_start(); ?> <!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"> <!-- .style1 { font-size: 36px; color: #FF0000; } .style2 {color: #333333} .style4 { font-size: 18px; font-weight: bold; color: #FF0000; } .style5 { color: #FF0000 } .style6 {font-size: 14px} --> </style> </head> <body> <form id="form1" name="form1" method="post" action="check_login.php"> <table width="200" border="0" align="center"> <tr> <td> </td> </tr> <tr> <td><table width="317" border="0" align="center"> <tr> <td height="88" colspan="3" align="center"><span class="style1">TW<span class="style2">shop</span></span></td> </tr> <tr> <td width="90" height="41"><strong>Username :</strong></td> <td width="144"><input type="text" name="uid" id="uid" /></td> <td width="69"> </td> </tr> <tr> <td height="45"><strong>Password :</strong></td> <td><input type="text" name="password" id="password" /></td> <td> </td> </tr> <tr> <td height="46"> </td> <td align="center"><input type="submit" name="submit" id="submit" value="Login" /></td> <td> </td> </tr> <tr> <td height="70" colspan="3" align="center" class="style4"><a href="newuser1.php" class="style5"><span class="style6">สมัครสมาชิกใหม</span>่</a></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> </form> </body> </html>
<? session_start(); ?> <!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"> <!-- .style1 {font-size: 36px} .style2 {color: #FF0000} .style3 {color: #333333} --> </style> </head> <body> <form id="form1" name="form1" method="POST" action=""> <table width="200" border="0" align="center"> <tr> <td> </td> </tr> <tr> <td><table width="276" height="229" border="0" align="center"> <tr> <td height="112" align="center"><p class="style1"><span class="style2">TW</span> <span class="style3">shop</span></p> <p>คุณใส่ข้อมูล ไม่ถูกต้อง</p></td> </tr> <tr> <td align="center">ฺ <a href="index.php">Login</a> อีกครั้ง </td> <? $sql = "member"; //ชื่อตาราง // เริ่มติดต่อฐานข้อมูล $con = mysql_connect("localhost","root","123456") or die("ไม่สามารถติดต่อ Server ได้"); // เลือกฐานข้อมูล mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); // คำสั่ง SQL และสั่งให้ทำงาน $sql = "select * from $sql where uid='$uid' and password='$password'"; //เช็คค่าข้อมูลที่ส่งมาจากฟอร์ม $dbquery = mysql_db_query($db, $sql); // หาจำนวนเรกคอร์ดข้อมูล $num_rows = mysql_num_rows($dbquery); if($num_rows==1){ header("location:http://locathost/twshop/product.php"); //ไปไปตามหน้าที่คุณต้องการ }else { $code_error="<BR><FONT COLOR=\"red\">ข้อมูลที่คุณกรอกไม่ถูกต้อง กรุณา Login ใหม่อีกครั้ง</FONT>"; session_register("code_error"); header("location: index.php"); //ไม่ถูกต้องให้กับไปหน้าเดิม } ?> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> </form> </body> </html>
<?php $sql = "member"; //ชื่อตาราง $sql = "select * from $sql where uid='$uid' and password='$password'"; //เช็คค่าข้อมูลที่ส่งมาจากฟอร์ม ?>
<?php $tb_name = "member"; //ชื่อตาราง $sql = "select * from $tb_name where uid='$uid' and password='$password'"; //เช็คค่าข้อมูลที่ส่งมาจากฟอร์ม ?>
<?php $uid = $_POST[uid]; $password = $_POST[password]; ?>
<? $con = mysql_connect("localhost","root","123456") or die("ไม่สามารถติดต่อ Server ได้");// เลือกฐานข้อมูล $db = mysql_select_db("twshop") or die("เลือกฐานข้อมูลไม่ได้"); $tb_name = "member"; //ชื่อตาราง $uid = $_POST[uid]; $password = $_POST[password]; $sql = "select * from $tb_name where uid='$uid' and password='$password'"; //เช็คค่าข้อมูลที่ส่งมาจากฟอร์ม $dbquery = mysql_db_query($db, $sql); // หาจำนวนเรกคอร์ดข้อมูล $num_rows = mysql_num_rows($dbquery); if($num_rows==1){ header("location:http://product.php"); //ไปไปตามหน้าที่คุณต้องการ }else { $code_error="<BR><FONT COLOR=\"red\">ข้อมูลที่คุณกรอกไม่ถูกต้อง กรุณา Login ใหม่อีกครั้ง</FONT>"; session_register("code_error"); header("location: index.php"); //ไม่ถูกต้องให้กับไปหน้าเดิม } ?>
<?php header("location:product.php"); //ไปไปตามหน้าที่คุณต้องการ ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง