<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>//什么意识?
<!--#include file="conn.asp" -->//什么意识?
<%
Dim index_login
Dim index_login_numRows
Set index_login = Server.CreateObject("ADODB.Recordset")
index_login.ActiveConnection = MM_database_STRING//这整句是做什么的?MM_database_STRING好像没被赋过值啊?
index_login.Source = "SELECT name, password FROM user"
index_login.CursorType = 0//这一段index_login.都是什么意识?
index_login.CursorLocation = 2
index_login.LockType = 1
index_login.Open()
index_login_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")//什么意识?
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))//cstr()是干什么的?
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="succeed.asp"//这个地方是什么意识?
MM_redirectLoginFailed="index.asp"//这个地方是什么意识?
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_database_STRING//这个是什么意识?MM_database_STRING他又是什么?
MM_rsUser.Source = "SELECT name, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM user WHERE name='" & Replace(MM_valUsername,"'","''") &"' AND password='" & Replace(Request.Form("password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And true Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!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></title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
body {
background-color: #EFEFF7;
}
-->
</style>
</head>
<body><form ACTION="<%=MM_LoginAction%>" method="POST" name="login" id="login" onSubmit="MM_validateForm('username','','R','password','','R');return document.MM_returnValue">//onSubmit这段都什么意识?
<br />
<table width="30%" height="150" border="0" align="center" cellpadding="0" cellspacing="0" class="border20">
<tr align="center">
<td height="30" colspan="2">系统入口</td>
</tr>
<tr>
<td width="40%" align="right">用户名:</td>
<td width="60%" height="30">
<input name="username" type="text" class="form01" id="username" size="15"> </td>
</tr>
<tr>
<td align="right">密 码:</td>
<td height="30">
<input name="password" type="password" class="form01" id="password" size="15"></td>
</tr>
<tr align="center">
<td height="30" colspan="2">
<input class="border21" type="submit" name="Submit" value="[ 登陆 ]">
</td>
</tr>
</table>
</form>
</body>
</html>[/size][/size]
这里面用MM开头的很多都是变量吗?为什么没定义?
[此贴子已经被作者于2007-12-23 19:05:33编辑过]