<?php
	session_start();
	include "conn/conn.php";
	header('content-type:text/html; charset=gb2312');
	$name = $_POST['name'];
	$password = $_POST['password'];
	if(empty($name) or empty($password)){
		echo "<script>alert('请填写登录信息');history.go(-1);</script>";
		exit();
	}
	$selectsql = "select id from tb_member where name = '".$name."' and password = '".md5(trim($password))."'";
	$rst = mysql_query($selectsql);
	if(mysql_num_rows($rst) == 1){
		$_SESSION['name'] = $name;
		echo "<script>alert('登录成功，欢迎光临!');location='index.php';</script>";
		exit();
	}else{
		echo "<script>alert('用户名或密码错误!');history.go(-1);</script>";
		exit();
	}
?>