我们的php端在本地服务器(Xamp-apach-5.5.6)中的全部工作但托管方没有工作(apache-5.2.17)请帮帮我。
public function login($username,$password)
{
session_start();
if($username==!NULL AND $password==!NULL)
{
global $pdo;
$password=md5($password);
$query = $pdo->prepare("SELECT * FROM employee_list WHERE username='$username' AND userpass='$password'");
$query->execute();
$row=$query->rowCount();
if($row==0)
{
$this->massage->loginmass("<span class='text-danger'>YOUR USERNAME AND PASSWORD NO MATCH.</span>");
}
else
{
$result = $query->fetch();
if($result['active_enactive']=="Active")
{
$_SESSION['mafizusernamerahman'] = $result['username'];
$_SESSION['mafizuserpassrahman'] =$result['userpass'];
$_SESSION['mafizaccess_permissionrahman'] = $result['access_permission'];
$_SESSION['mafizactive_enactiverahman'] = $result['active_enactive'];
$_SESSION['mafiznamerahman'] = $result['name'];
$_SESSION['mafizemployment_idrahman'] = $result['employment_id'];
$_SESSION['mafizfather_namerahman'] = $result['father_name'];
$_SESSION['developer'] = "Mafizur";
if($_SESSION['mafizaccess_permissionrahman']=="Admin")
header("location:all-employee.php");
elseif($_SESSION['mafizaccess_permissionrahman']=="User")
{
if (empty($result['defaltpass'])) {
header("location:user-profile.php");
}
else
header("location:defaltchange-password.php");
}
}
else
$this->massage->loginmass("<span class='text-danger'>YOUR ACCOUNT SUSPEND.</span>");
}
}
else
$this->massage->loginmass("<span class='text-danger'>PLEASE FILL UP YOURUSER NAME AND PASSWORD.</span>");
}
在Location
重定向中使用相对URL时需要小心。
因此,如果在标题中打印绝对URL而不是相对URL,效果会更好。
https://en.wikipedia.org/wiki/HTTP_location