Warning: session_register(): Cannot send session cookie - headers already sent by (output started at d:\ip1\silamaneeresortandspa.com\include\dbconnect.php:13) in d:\ip1\silamaneeresortandspa.com\admin\check.php on line 14
Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at d:\ip1\silamaneeresortandspa.com\include\dbconnect.php:13) in d:\ip1\silamaneeresortandspa.com\admin\check.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at d:\ip1\silamaneeresortandspa.com\include\dbconnect.php:13) in d:\ip1\silamaneeresortandspa.com\admin\check.php on line 15
Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/narahos/domains/narahospital.com/public_html/it/bg/checklogin1.php:2) in /home/narahos/domains/narahospital.com/public_html/it/bg/checklogin1.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/narahos/domains/narahospital.com/public_html/it/bg/checklogin1.php:2) in /home/narahos/domains/narahospital.com/public_html/it/bg/checklogin1.php on line 38
<?ob_start();?>
<?php
//ob_start();
$host="localhost"; // Host name
$username="narahos_it"; // Mysql username
$password="8112"; // Mysql password
$db_name="narahos_it"; // Database name
//$tbl_name="member"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Define $myusername and $mypassword
$user=$_POST['user'];
$pass=$_POST['pass'];
// To protect MySQL injection (more detail about MySQL injection)
$user = stripslashes($user);
$pass = stripslashes($pass);
$user = mysql_real_escape_string($user);
$pass = mysql_real_escape_string($pass);
$sql="SELECT * FROM member WHERE user='$user' and pass='$pass'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("user");
session_register("pass");
header("location:menu10.php");
}
//ocation:www.it.narahos_it/bg/menu.php
else {
echo "Wrong Username or Password";
}
ob_end_flush();
?>
ช่วยเเนะนำด้วยนะครับ
Date :
9 ต.ค. 2551 10:39:28
By :
ใหม่
No. 4
Guest
<?ob_start();?>
<?php
//ob_start();
$host="localhost"; // Host name
$username="narahos_it"; // Mysql username
$password="8112"; // Mysql password
$db_name="narahos_it"; // Database name
//$tbl_name="member"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Define $myusername and $mypassword
$user=$_POST['user'];
$pass=$_POST['pass'];
// To protect MySQL injection (more detail about MySQL injection)
$user = stripslashes($user);
$pass = stripslashes($pass);
$user = mysql_real_escape_string($user);
$pass = mysql_real_escape_string($pass);
$sql="SELECT * FROM member WHERE user='$user' and pass='$pass'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("user"); มีปัญหาบรรทัดนี้ครับ
session_register("pass"); มีปัญหาบรรทัดนี้ครับ
header("location:menu10.php"); มีปัญหาบรรทัดนี้ครับ
}
//ocation:www.it.narahos_it/bg/menu.php
else {
echo "Wrong Username or Password";
}