时间:2021-07-01 10:21:17 帮助过:7人阅读
管理员登录
$user=$_POST['user'];
$pass=$_POST['pass'];
$link=mysql_connect("localhost","root","");
$db=mysql_select_db("blog",$link);
mysql_query("set names utf8");
$sql="select * from user where username='$user'";
$result=mysql_query($sql);
while($row=mysql_fetch_row($result)){
$username=$row['username'];//用单引号就是不行。
$password=$row[2];
}
echo $username;
echo "
";
echo $password;
?>