<?php
header("Content-Type:text/html;charset=utf-8");
session_start();
require_once("global/connect.php");
$username=$_POST["username"];
$password=$_POST["password"];
//echo $password;
$sql=mysql_query("select * from user where username='$username' and password='$password'");
if(mysql_num_rows($sql)==0){
echo "<script>alert('登录失败！请检查用户名或密码是否正确。');top.window.location.href='index.php';</script>";
}else{
while($row=mysql_fetch_array($sql)){
$username=$row["username"];
$auth=$row["auth"];
$name=$row["name"];
$_SESSION['username']=$username;
$_SESSION['auth']=$auth;
$_SESSION['name']=$name;
echo "<script>window.location.href='datacount/flow/rwdata.php';</script>";
}
}
?>