 |
|
Warning: Cannot modify header information - headers already sent by (output started at
ผมเจออาการแบบนี้ต้องแก้ไขยังไงครับ

functions.php
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<?
require 'common.inc' ;
$admin1="pu_admin";
$password1="16282827";
// Display error messages
function DisplayErrMsg( $message )
{
printf("<blockquote><blockquote><blockquote><h3><font color=\"#cc0000\">
%s</font></h3></blockquote></blockquote></blockquote>\n", $message);
}
function authenticateUser($user, $password)
{
global $DB_SERVER, $HTTP__HOST, $DB_LOGIN, $DB_PASSWORD, $DB, $DOCROOT ;
// Open a persistent connection with the MySQl server
if (!($link = mysql_pconnect ($DB_SERVER,$DB_LOGIN, $DB_PASSWORD))) {
// DisplayErrMsg(sprintf("internal error %d:%s\n",
// mysql_errno(), mysql_error()));
DisplayErrMsg(sprintf("internal error %s %s %s %d:%s\n",$DB_SERVER, $DB_LOGIN, $DB_PASSWORD,
mysql_errno(), mysql_error()));
return 0 ;
}
// Do the user/password authentication
if (!($result = mysql_db_query("$DB", "select * from member where
user_id='$user'"))) {
DisplayErrMsg(sprintf("internal error %d:%s\n",
mysql_errno(), mysql_error()));
return 0 ;
}
if (($row = mysql_fetch_array($result)) && ($password == $row["password"]
&& $password != ""))
return 1 ;
else
return 0 ;
}
?>
login.php
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<? ob_start()
require "functions.php" ;
//delete all the old cookies
deleteCookies() ;
if (authenticateUser($form_user_id, $form_password))
{
setcookie("cookie_passwd",$form_password);
setcookie("cookie_user",$form_user_id);
header("Location:http://$HTTP_HOST/$DOCROOT/member_complete.php"); //ถ้า login ผ่านให้มาหน้า meber_complete
exit();
} else {
header("Location:http://$HTTP_HOST/$DOCROOT/login_false.php");//ถ้า login ไม่ผ่านให้มาหน้า login_false
exit() ;
}
function deleteCookies()
{
// delete all the old cookies
for($i=0; $i<$total_items; $i++)
{
setcookie("items_tray[$i]", "");
setcookie("quantity[$i]", "");
}
setcookie("items_tray","");
setcookie("total_items","");
setcookie("quantity","") ;
}
ob_end_flush() ?>
Tag : PHP, MySQL, JavaScript
|
ประวัติการแก้ไข 2015-11-15 13:16:41 2015-11-15 13:17:50 2015-11-15 13:18:40
|
 |
 |
 |
 |
Date :
2015-11-15 13:15:14 |
By :
itsmeice |
View :
2673 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |