136 lines
4.7 KiB
PHP
136 lines
4.7 KiB
PHP
|
<?php require_once('Connections/jc.php'); ?>
|
|||
|
<?php
|
|||
|
// *** Validate request to login to this site.
|
|||
|
if (!isset($_SESSION)) {
|
|||
|
session_start();
|
|||
|
}
|
|||
|
|
|||
|
$loginFormAction = $_SERVER['PHP_SELF'];
|
|||
|
if (isset($_GET['accesscheck'])) {
|
|||
|
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
|
|||
|
}
|
|||
|
|
|||
|
if (isset($_POST['username'])) {
|
|||
|
$loginUsername=$_POST['username'];
|
|||
|
$password=$_POST['password'];
|
|||
|
$MM_fldUserAuthorization = "";
|
|||
|
$MM_redirectLoginSuccess = "xi.php";
|
|||
|
$MM_redirectLoginFailed = "xindex.php";
|
|||
|
$MM_redirecttoReferrer = false;
|
|||
|
mysql_select_db($database_jc, $jc);
|
|||
|
|
|||
|
$LoginRS__query=sprintf("SELECT user_name, password FROM xi WHERE user_name='%s' AND password='%s'",
|
|||
|
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
|
|||
|
|
|||
|
$LoginRS = mysql_query($LoginRS__query, $jc) or die(mysql_error());
|
|||
|
$loginFoundUser = mysql_num_rows($LoginRS);
|
|||
|
if ($loginFoundUser) {
|
|||
|
$loginStrGroup = "";
|
|||
|
|
|||
|
//declare two session variables and assign them
|
|||
|
$_SESSION['MM_Username'] = $loginUsername;
|
|||
|
$_SESSION['MM_UserGroup'] = $loginStrGroup;
|
|||
|
|
|||
|
if (isset($_SESSION['PrevUrl']) && false) {
|
|||
|
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
|
|||
|
}
|
|||
|
header("Location: " . $MM_redirectLoginSuccess );
|
|||
|
}
|
|||
|
else {
|
|||
|
header("Location: ". $MM_redirectLoginFailed );
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
<html>
|
|||
|
|
|||
|
<head>
|
|||
|
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
|||
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
|||
|
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
|
|||
|
<link href="css/style.css" rel="stylesheet">
|
|||
|
<title>PHP<EFBFBD>̲Ĺ<EFBFBD><EFBFBD><EFBFBD>ϵͳ</title>
|
|||
|
<script language="JavaScript">
|
|||
|
<!--
|
|||
|
<!--
|
|||
|
|
|||
|
function Juge(theForm)
|
|||
|
{
|
|||
|
if (theForm.username.value == "")
|
|||
|
{
|
|||
|
alert("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|||
|
theForm.username.focus();
|
|||
|
return (false);
|
|||
|
}
|
|||
|
if (theForm.password.value == "")
|
|||
|
{
|
|||
|
alert("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|||
|
theForm.password.focus();
|
|||
|
return (false);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function MM_jumpMenu(targ,selObj,restore){ //v3.0
|
|||
|
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
|
|||
|
if (restore) selObj.selectedIndex=0;
|
|||
|
}
|
|||
|
//-->
|
|||
|
</script>
|
|||
|
</head>
|
|||
|
|
|||
|
<body bgcolor=#21415a>
|
|||
|
|
|||
|
<p><EFBFBD><EFBFBD></p>
|
|||
|
<p><EFBFBD><EFBFBD></p>
|
|||
|
<p align="center">
|
|||
|
<img border="0" src="img/index.jpg" width="568" height="252"></p>
|
|||
|
<form action="<?php echo $loginFormAction; ?>" name="theform" method="POST" onSubmit="return Juge(this)">
|
|||
|
<div align="center">
|
|||
|
<center>
|
|||
|
<table border="0" width="568" bgcolor=#21415a style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
|
|||
|
<tr>
|
|||
|
<td width="100%" style="font-size: 12px">
|
|||
|
<p style="margin-top: 0; margin-bottom: 0" align="center">
|
|||
|
<font color="#FFFFFF"><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>½<EFBFBD><EFBFBD></font>
|
|||
|
<select name="select" id="select" onChange="MM_jumpMenu('parent',this,0)">
|
|||
|
<option value="index.php">ѧ<EFBFBD><EFBFBD></option>
|
|||
|
<option value="lindex.php"><EFBFBD><EFBFBD>ʦ</option>
|
|||
|
<option value="xindex.php" selected>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա</option>
|
|||
|
<option value="gindex.php"><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա</option>
|
|||
|
</select>
|
|||
|
</p>
|
|||
|
|
|||
|
<p style="margin-top: 0; margin-bottom: 0" align="center">
|
|||
|
<EFBFBD><EFBFBD></p>
|
|||
|
|
|||
|
<table border="0" width="333" bgcolor=#21415a align=center height="72">
|
|||
|
<tr>
|
|||
|
<TD width="125" style="font-size: 12px" height="17">
|
|||
|
<font color="#FFFFFF"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD></font> </TD>
|
|||
|
<TD width="194" style="font-size: 12px" height="17">
|
|||
|
<input type="text" name="username" size="17" class="text" onBlur="this.className='text'" onFocus="this.className='textedit';this.select()"> </TD>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<TD width="125" style="font-size: 12px" height="13">
|
|||
|
<font color="#FFFFFF"><EFBFBD><EFBFBD> <EFBFBD>룺 </font> </TD>
|
|||
|
<TD width="194" style="font-size: 12px" height="13">
|
|||
|
<INPUT type=password maxLength=20 name=password size="17" class="text" onBlur="this.className='text'" onFocus="this.className='textedit';this.select()"> </TD>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<TD align=middle
|
|||
|
colSpan=2 width="325" style="font-size: 12px" height="30">
|
|||
|
<p align="center" style="margin-top: 0; margin-bottom: 0">
|
|||
|
<EFBFBD><EFBFBD></p>
|
|||
|
<p align="center" style="margin-top: 0; margin-bottom: 0">
|
|||
|
<INPUT type=submit value=" <20><> ¼ " name=login class="buttonface">
|
|||
|
<INPUT type=reset value=" <20><> <20><> " name=qingchu class="buttonface">
|
|||
|
</p> </TD>
|
|||
|
</tr>
|
|||
|
</table> </td>
|
|||
|
</tr>
|
|||
|
</table>
|
|||
|
</center>
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
</body>
|
|||
|
|
|||
|
</html>
|