<?php
include 'config.php';
session_start();//启动会话
//获取用户的登录信息。用户名,密码,是否保存信息
$UserName1=$HTTP_POST_VARS["UserName"];
$Password1=$HTTP_POST_VARS["Password"];
//查询用户名是否存在
$query="select * from user where username='$UserName1'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
if ($row)
{
echo $UserName1;
//查询用户是否已经激活
if ($row["pssword"]==sha1($Password1))
echo "认证成功<br>";
else{
echo "password is wrong";
}
}
else
{
echo "user is wrong";
}
?>