Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\member\chkmember.php:2) in C:\AppServ\www\member\chkmember.php on line 18
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\member\chkmember.php:2) in C:\AppServ\www\member\chkmember.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\member\chkmember.php:2) in C:\AppServ\www\member\chkmember.php on line 21
โค๊ตครับ
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"/>
<?
$user_login=$_POST[user_login];
$pass_login=$_POST[pass_login];
if ($user_login=="" or $pass_login=="") {
echo "<h3>ERROR : กรุณากรอกข้อมูลให้ครบนะครับ<h3>"; exit();
}
include "connect.php";
$sql="select * from tb_member where username='$user_login' and password='$pass_login'";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
mysql_close();
if($num<=0) {
echo "<h3>ERROR : Username หรือ Password ผิดนะครับ</h3>";
} else {
session_start();
$_SESSION[sess_userid]=session_id();
$_SESSION[sess_username]=$user_login;
header("Location: main.php");
}
?>