几个已实现功能的页面代码:
infoquery.asp
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/StudentConn.asp" -->
<%
Dim rsGrade1__MMColParam
rsGrade1__MMColParam = "0"
If (Request("MM_EmptyValue") <> "") Then
rsGrade1__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rsGrade1
Dim rsGrade1_numRows
Set rsGrade1 = Server.CreateObject("ADODB.Recordset")
rsGrade1.ActiveConnection = MM_StudentConn_STRING
rsGrade1.Source = "SELECT * FROM Class WHERE Grade = " + Replace(rsGrade1__MMColParam, "'", "''") + " ORDER BY ClassID ASC"
rsGrade1.CursorType = 0
rsGrade1.CursorLocation = 2
rsGrade1.LockType = 1
rsGrade1.Open()
rsGrade1_numRows = 0
%>
<%
Dim rsGrade2__MMColParam
rsGrade2__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
rsGrade2__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rsGrade2
Dim rsGrade2_numRows
Set rsGrade2 = Server.CreateObject("ADODB.Recordset")
rsGrade2.ActiveConnection = MM_StudentConn_STRING
rsGrade2.Source = "SELECT * FROM Class WHERE Grade = " + Replace(rsGrade2__MMColParam, "'", "''") + " ORDER BY ClassID ASC"
rsGrade2.CursorType = 0
rsGrade2.CursorLocation = 2
rsGrade2.LockType = 1
rsGrade2.Open()
rsGrade2_numRows = 0
%>
<%
Dim rsGrade3__MMColParam
rsGrade3__MMColParam = "2"
If (Request("MM_EmptyValue") <> "") Then
rsGrade3__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rsGrade3
Dim rsGrade3_numRows
Set rsGrade3 = Server.CreateObject("ADODB.Recordset")
rsGrade3.ActiveConnection = MM_StudentConn_STRING
rsGrade3.Source = "SELECT * FROM Class WHERE Grade = " + Replace(rsGrade3__MMColParam, "'", "''") + " ORDER BY ClassID ASC"
rsGrade3.CursorType = 0
rsGrade3.CursorLocation = 2
rsGrade3.LockType = 1
rsGrade3.Open()
rsGrade3_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>学生信息查询</TITLE>
<
<
<link href="home.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function check1()
{
if(document.form1.StudentNum.value=="")
{
alert("你还没有填学号");
document.form1.StudentNum.focus();
return false;
}
}
function check2()
{
if(document.form2.Name.value=="")
{
alert("你还没有填姓名");
document.form2.Name.focus();
return false;
}
}
</script>
<script language="JavaScript" type="text/JavaScript">
function ChangeClass()
{
var i;
for(i=document.form3.ClassSelect.options.length-1;i>=0;i--)
{
document.form3.ClassSelect.options[i]=null;
}
switch(document.form3.Grade.selectedIndex)
{
case 0:
for(i=0;i<document.Classes.Grade1.options.length;i++)
{
document.form3.ClassSelect.options[i]=new Option(document.Classes.Grade1.options[i].text,document.Classes.Grade1.options[i].value);
}
break;
case 1:
for(i=0;i<document.Classes.Grade2.options.length;i++)
{
document.form3.ClassSelect.options[i]=new Option(document.Classes.Grade2.options[i].text,document.Classes.Grade2.options[i].value);
}
break;
case 2:
for(i=0;i<document.Classes.Grade3.options.length;i++)
{
document.form3.ClassSelect.options[i]=new Option(document.Classes.Grade3.options[i].text,document.Classes.Grade3.options[i].value);
}
break;
}
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0>
<div id="Layer1" style="position:absolute; left:445px; top:220px; width:188px; height:64px; z-index:1; visibility: hidden;">
<form name="Classes" method="post" action="">
<select name="Grade1" id="select">
<option value="All">全级</option>
<%
While (NOT rsGrade1.EOF)
%>
<option value="<%=(rsGrade1.Fields.Item("ClassID").Value)%>"><%=(rsGrade1.Fields.Item("grade").Value)%></option>
<%
rsGrade1.MoveNext()
Wend
If (rsGrade1.CursorType > 0) Then
rsGrade1.MoveFirst
Else
rsGrade1.Requery
End If
%>
</select>
<select name="Grade2" id="select2">
<option value="All">全级</option>
<%
While (NOT rsGrade2.EOF)
%>
<option value="<%=(rsGrade2.Fields.Item("ClassID").Value)%>"><%=(rsGrade2.Fields.Item("grade").Value)%></option>
<%
rsGrade2.MoveNext()
Wend
If (rsGrade2.CursorType > 0) Then
rsGrade2.MoveFirst
Else
rsGrade2.Requery
End If
%>
</select>
<select name="Grade3" id="Grade3">
<option value="All">全级</option>
<%
While (NOT rsGrade3.EOF)
%>
<option value="<%=(rsGrade3.Fields.Item("ClassID").Value)%>"><%=(rsGrade3.Fields.Item("ClassName").Value)%></option>
<%
rsGrade3.MoveNext()
Wend
If (rsGrade3.CursorType > 0) Then
rsGrade3.MoveFirst
Else
rsGrade3.Requery
End If
%>
</select>
</form>
</div>
<!--#include file="InfoManage_top.asp" -->
<TABLE width="760" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD width=1 background="images/dotLine_h.gif"><IMG src="images/shim(1).gif" width=1></TD>
<TD Width="100" align="center" bgcolor="#EEEEEE"> </TD>
<td width="10" bgcolor="#F2FBF2"></td>
<TD bgcolor="#F2FBF2"><img src="images/InfoQurey_Title.GIF"><br>
<br>
<b>请输入查询的条件:</b>
<table width="300" border="0" cellspacing="0" cellpadding="5">
<form Name="form1" onSubmit="return check1()" action="InfoQuery1.asp" method="post">
<tr>
<td width="80" align="right" nowrap>按学号查询:</td>
<td width="150"> <input name="StudentNum" type="text" id="StudentNum" size="18" maxlength="8"></td>
<td width="44"> <input type="submit" name="Submit1" value="查询"></td>
</tr>
</form>
<form Name="form2" onSubmit="return check2()" action="InfoQuery1.asp" method="post">
<tr>
<td width="80" align="right" nowrap>按姓名查询:</td>
<td width="150"> <input type="text" name="Name" maxlength="8" size="18"></td>
<td> <input type="submit" name="Submit2" value="查询"></td>
</tr>
</form>
<form Name="form3" action="InfoQuery1.asp" method="post">
</form>
</table>
<p><b>注:</b><br>
1、可从学号、姓名查询方法任选其一进行查询。<br>
<br>
2、支持模糊查询!</font><br>
例如:<br>
在学号查询框中输入2001,则查询结果为学号中包含“2001”的学生<br>
在姓名中输入“小”,则查询结果为姓名中包含有“小”的学生<br>
<br>
<br>
</p></td>
<TD width=1 background="images/dotLine_h.gif"><IMG src="images/shim(1).gif" width=1></TD>
</TR>
<tr>
<TD height="1" colspan="7" background="images/dotLine_w.gif"><IMG height=1 src="images/shim(1).gif" width=100></TD>
</tr>
</TBODY>
</TABLE>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
</tr>
</table></BODY>
</HTML>
<%
rsGrade1.Close()
Set rsGrade1 = Nothing
%>
<%
rsGrade2.Close()
Set rsGrade2 = Nothing
%>
<%
rsGrade3.Close()
Set rsGrade3 = Nothing
%>
checklogin.asp
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="Login.asp"
MM_grantAccess=false
If Session("MM_UserName") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
上一页 [1] [2] [3] [4] [5] [6] [7] [8]