?? login.php
字號:
<?
session_start();
require "fun.php";
require "config.php";
//
$action=$_GET['action'];
if ($_SESSION['login_status']=="common1") header ("Location:"."index.php");
if($action=="loginout")
{
session_unregister('login_status');
session_unregister('username');
header ("Location:"."index.php");
}
elseif($action=="login")
{
$user_name=$_POST['user_name'];
$psd=$_POST['psd'];
if(!file_exists("$sys_data_dir/user/$user_name.php"))
{
echo "對不起,不存在此用戶,請確認(rèn)您沒有輸入錯(cuò)誤,<a href=login.php>返回重新輸入</a>";
}
else
{
$user_data=file("$sys_data_dir/user/$user_name.php");
$user_info=explode("|",$user_data[0]);
if(md5($psd)==$user_info[1])
{
$_SESSION['login_status']="common1";
$_SESSION['username']=$user_info[0];
header ("Location:"."index.php");
}
else
{
echo "對不起,密碼錯(cuò)誤,請確認(rèn)您沒有輸入錯(cuò)誤,<a href=login.php>返回重新輸入</a>";
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>會員登錄--<?=$sys_site_name?></title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="images/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle"><div align="center"><?
if (empty($action))
{
print <<<EOT
<p> </p>
<p> </p>
<p> </p>
<table width="195" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="login" method="post" action="login.php?action=login">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>帳號:
<input name="user_name" type="text" id="user_name" size="24" maxlength="12" /></td>
</tr>
<tr>
<td>密碼:
<input name="psd" type="password" id="psd" size="25" maxlength="16" /></td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="Submit" value="提交" />
<input type="reset" name="Submit2" value="重置" />
</div></td>
</tr>
</form>
</table>
EOT;
}
?></div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -