我做了一个网站,有三个管理员界面,在本地三个管理员都可以登录,但代码上传到服务器后,只能一个管理员登录,这是为什么
文件1
<html>
<head>
<title>管理员1登录</title>
<style type="text/css">
body {background-color: #EEE8AA;}
</style>
</head>
<body>
<?php
header("Content-Type:text/html;charset=utf-8");
?>
<p><a href='../admin1_table.php'>返回</a></p>
<h1>管理员1登录</h1>
<form method='post' action='select2.php'>
<table border="1" cellpadding='0'cellspacing='0'>
<tr><td>管理员1名:</td><td><input name='admin1_name' type='text' /></td></tr>
<tr><td>密码:</td><td><input name='password' type='password' /></td></tr>
<tr><td></td><td><input type='submit' value='登录' /></td></tr>
</table>
</form>
</body>
</html>
文件2
<html>
<head>
<title>执行登录</title>
<style type="text/css">
body {background-color: #EEE8AA;}
</style>
</head>
<body>
<?php
header("Content-Type:text/html;charset=utf-8");
if (empty($_POST["admin1_name"] or $_POST["password"] )){echo "输入框不能为空! <a href='select1.php'>返回</a>";die;}
session_start();
$_SESSION['admin1_name']=$_POST['admin1_name'];
require '../../../../public_file/database_connection.php';
$select=mysql_query("select * from admin1_table where admin1_name='".$_POST['admin1_name']."' and password='".$_POST['password']."'");
if(mysql_num_rows($select)==1){echo "登录成功!<a href='../../admin1.php'>进入管理员1操作界面</a>";die;}
if(mysql_num_rows($select)==0){echo "登录失败!<a href='select1.php'>返回</a>";die;}
?>
</body>
</html>
文件3
<html >
<head>
<title>注销</title>
</head>
<body>
<?php
header("Content-Type:text/html;charset=utf-8");
session_start();
$_SESSION=array();
session_destroy();
header("location:../admin1_table.php");
?>
</body>
</html>