⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStockObject CFont GetWindo
💻 PHP
字号:
<?php require_once('include/connectionindex.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];

if (isset($_POST['name'])) {
  $loginUsername=$_POST['name'];
  $password=md5($_POST['password']);
  
  $LoginSuccessgoto = "user.php";
  $LoginFailedgoto= "index.php?error=1";
  $MM_redirecttoReferrer = false;
  
  	
  $loginsql=sprintf("SELECT userlevel,deptno FROM user WHERE name='%s' AND password='%s'",
  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 
   
  $loginsqlresult= odbc_exec($conn,$loginsql); 
  $loginFoundUser = odbc_fetch_row($loginsqlresult);
  if ($loginFoundUser) {
    
    $loginlevel  = odbc_result($loginsqlresult,'userlevel');
    $dept=odbc_result($loginsqlresult,'deptno');
    //declare two session variables and assign them
    $GLOBALS['MM_Username'] = $loginUsername;
    $GLOBALS['MM_Userlevel'] = $loginlevel;
    $GLOBALS['dept'] = $dept;	      

    //register the session variables
    session_register("MM_Username");
    session_register("MM_Userlevel");
    session_register("dept");

    if($dept==2)
	$LoginSuccessgoto="dept_2/dieingdept.php";
	if($dept==3)
	$LoginSuccessgoto="dept_3/collectdept.php";
    header("Location: " . $LoginSuccessgoto );
  }
  else {
    header("Location: ". $LoginFailedgoto );
  }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="酒店管理系统, timilzy" name=KEYWORDS>
<meta 
content="酒店管理系统,包括接待部,餐饮部,采购部,经理部,分前后台" 
name=DESCRIPTION>
<title>酒店管理系统</title>
<link href="css/hotel.css" rel="stylesheet" type="text/css">
</head>

<body>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="330" border="1" align="center">
<tr>
<td>
<br \>
<p align="center">XX 酒店系统
<br>Entrance</br></p>


<form ACTION="<?php echo $loginFormAction; ?>" name="form1" method="POST">
  <table width="50%"  border="0" align="center" cellpadding="6">
    <tr>
      <td width="42%"><div align="right">用户名:</div></td>
      <td width="58%"><input name="name" type="text" id="name" value="timilzy" size="20" maxlength="20">
      </td>
    </tr>
    <tr>
      <td height="39"><div align="right">密 码:</div></td>
      <td><input name="password" type="password" id="password" value="96169" size="20" maxlength="20">
      </td>
    </tr>
    <tr>
      <td colspan="2"><div align="right"><iframe id="error" src="error.php<? if (isset($_GET['error'])&&!empty($_GET['error'])){?>?error=<? echo $_GET['error'];}?>" frameborder="0" scrolling="no" width="200" height="15"></iframe>
      </div></td>
    </tr>
    <tr>
      <td></td>
      <td><p align="left">
        <input type="submit" name="Submit" value="提交">
       
          <label>
          &nbsp;
          <input type="reset" name="Submit2" value="重置">
          </label>
          </p></td>
    </tr>
  </table>
</form>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p> </p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -