<form method='post' action='chk_user.php'> <table width="800" border="0" cellpadding="8" cellspacing="0"> <tr> <td align="right" bgcolor="#FFFFFF"><strong class="font-gray-12px">USERNAME : </strong></td> <td align="left" bgcolor="#FFFFFF"><input type="text" name="username" style="width:300px;"></td> </tr> <tr> <td align="right" bgcolor="#FFFFFF"><strong class="font-gray-12px">PASSWORD : </strong></td> <td align="left" bgcolor="#FFFFFF"><input type="password" name="password" style="width:300px;"></td> </tr> <tr> <td align="right" bgcolor="#FFFFFF"> </td> <td width="526" align="left" bgcolor="#FFFFFF"><label> <input type="submit" name="Submit" value="SUBMIT" style="background-color: #000; width:70px; height:25px; color:#fff; font-weight:bold; border:1px solid #666;"> <input type="reset" name="Submit2" value="CANCLE" style="background-color: #000; width:70px; height:25px; color:#fff; font-weight:bold; border:1px solid #666;"> </label></td> </tr> </table> </form>
<?php session_start(); include "connect.php"; $username=$_POST["username"]; $password=$_POST["password"]; $sql = "select * from xxxxx where username='$username' and password='$password'"; $result=mysql_query($sql,$conn) ; $rs = mysql_fetch_array($result); if(mysql_num_rows($result) != 0) { $_SESSION[sess_userid] = $session_id; $_SESSION[sess_username] = $username; $_SESSION[sess_add_id] =$rs["admin_id"]; $_SESSION[sess_name] =$rs["admin_name"]; $_SESSION[sess_type] =$rs["admin_type"]; header("Location:index.php"); } else { header("Location:index.html"); } ?>
<?php session_start(); $sess_userid = $_SESSION[sess_userid]; $sess_username = $_SESSION[sess_username]; $sess_add_id = $_SESSION[sess_add_id]; $sess_name = $_SESSION[sess_name]; $sess_type = $_SESSION[sess_type]; if($sess_userid <>$session_id or $sess_username=="") { header("Location:index.html"); exit(); } include "connect.php"; ?>
<? $host="localhost"; $username="root"; $password=""; $dbname="xxxxx_db"; $conn=mysql_connect( $host,$username,$password) or die ("cannot connect Mysql"); mysql_select_db($dbname) or die("เชื่อมต่อฐานข้อมูลไม่ได้"); mysql_db_query("$dbname","SET NAMES utf8"); mysql_query("SET character_set_results =NULL"); ?>
<?php include "chk_login.php"; $mode = $_GET['mode']; $Page = $_GET['Page']; ?>
Quote:Warning: Cannot modify header information - headers already sent by
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง