<?php
 session_start();
 include "../datasource.inc.php";
 require_once "../MessageBox.php";
 $Message  = new MessageBox;
 $query    = "select * from zht_user where userid='$_REQUEST[userid]' and userpwd=password('$_REQUEST[userpwd]') and userjs='1'";
 $result   = mysql_query($query) or die(mysql_error());
 $row      = mysql_fetch_array($result);
 if ( mysql_num_rows($result) > 0 ){
 	 $_SESSION["adminuser"]   = $row['userid'];
 	 $_SESSION["userjs"]      = $row['userjs'];
	 header("Location:main.php");
 } else {
    $Message->setMessage("对不起，您没有权限进入后台管理!","index.php");
    $Message->showMessage();
 }

?>
