1

函数登录()

{

if(isset($_POST['signin']))

{

全球 $con;

全局$db;

$name=$_POST['uname'];

$pwd=$_POST['pass'];

$name = stripcslashes($name);

$pwd = stripcslashes($pwd);

if($name!=''&& $pwd!='')

{

$query=mysqli_query($con, "select * from banmoh where username='".$name."' and password='".$pwd."'") or die(mysqli_error());

$res=mysqli_fetch_row($query);

如果($res)

{

session_start();

$_SESSION['uname']=$name;

$_SESSION['pass']=$pwd;

标头('位置:dashboard.php');

}

别的

{

header('location:index.php?error');

}

}

}

4

0 回答 0