我的 PHP 注销脚本有问题 我有以下代码:
<?php
session_start();
//redirect function
function returnheader($location){
$returnheader = header("location: $location");
return $returnheader;
}
$connection = mysql_connect("localhost","username","password") OR die(mysql_error());
$db_select = mysql_select_db("database",$connection) OR die(mysql_error());
// destroy cookies and sessions
setcookie("userloggedin", "");
$username = "";
session_destroy();
//redirect
returnheader("index.php");
?>
我不断收到以下错误:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'loginuser'@'localhost' (using password: YES) in logout.php on line 10
用户'loginuser'@'localhost'的访问被拒绝(使用密码:是)
任何人都可以帮助我是 php 的新手,并且可能比我能咀嚼的更多:)