请各位帮我看一哈我的这个页面的程序有什么问题嘛??我实在是不懂,又真的很急,谢谢了1!!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Contents.Remove("MM_Username")
Session.Contents.Remove("MM_UserAuthorization")
MM_logoutRedirectPage = "default.asp"
redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Abandon
MM_logoutRedirectPage = "default.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Abandon
MM_logoutRedirectPage = "default.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
if (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Abandon
MM_logoutRedirectPage = "default.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "../../cjluntan/final/%22)%20Then%20MM_logoutRedirectPage%20=%20CStr(Request.ServerVariables(%22URL") Then
if (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
if (Item <> "MM_Logoutnow") Then
if (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End if
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End if
Response.Redirect(MM_logoutRedirectPage)
End if
End if
%>
<!--#include file="../Connections/Myconn.asp" -->
<!--#include file="../Connections/Myconn.asp" -->
<%
FUNCTION AddPostNum()
if(Session("MM_Username") <> "") then commAddPostNum__CurrentUserID = Session("MM_Username")
set commAddPostNum = Server.CreateObject("ADODB.Command")
commAddPostNum.ActiveConnection = MM_connBHP_STRING
commAddPostNum.CommandText = "UPDATE tUsers SET fPostNum = fPostNum + 1 WHERE fUserID = '" + Replace(commAddPostNum__CurrentUserID, "'", "''") + "' "
commAddPostNum.CommandType = 1
commAddPostNum.CommandTimeout = 0
commAddPostNum.Prepared = true
commAddPostNum.Execute()
END FUNCTION
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../cjluntan/final/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
%>
<%
' *** Edit Operations: declare variables
MM_editAction = CStr(Request("URL"))
if (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End if
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
if (CStr(Request("MM_insert")) <> "") Then
MM_editConnection = MM_Myconn_STRING
MM_editTable = "tBBS"
MM_editRedirectUrl = "default.asp"
MM_fieldsStr = "fTitle|value|fContent|value|fIP|value|fPoster|value|fSubject|value"
MM_columnsStr = "fTitle|',none,''|fContent|',none,''|fIP|',none,''|fPoster|',none,''|fSubject|none,none,NULL"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next
' append the query string to the redirect URL
if (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
if (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End if
End if
End if
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
if (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
if (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
if (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
if (EmptyVal = "none") Then EmptyVal = ""
if (FormVal = "") Then
FormVal = EmptyVal
Else
if (AltVal <> "") Then
FormVal = AltVal
Elseif (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End if
End if
if (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
if (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
if (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End if
End if
End if
%>
<%
set rsSubject = Server.CreateObject("ADODB.Recordset")
rsSubject.ActiveConnection = MM_Myconn_STRING
rsSubject.Source = "SELECT * FROM tBBSSubject"
rsSubject.CursorType = 0
rsSubject.CursorLocation = 2
rsSubject.LockType = 3
rsSubject.Open()
rsSubject_numRows = 0
%>
<%
Dim rsMaster__MMColParam
rsMaster__MMColParam = "1"
if (Request.QueryString("fSubject") <> "") then rsMaster__MMColParam = Request.QueryString("fSubject")
%>
<%
set rsMaster = Server.CreateObject("ADODB.Recordset")
rsMaster.ActiveConnection = MM_Myconn_STRING
rsMaster.Source = "SELECT fUserID FROM tUsers WHERE fHost = " + Replace(rsMaster__MMColParam, "'", "''") + ""
rsMaster.CursorType = 0
rsMaster.CursorLocation = 2
rsMaster.LockType = 3
rsMaster.Open()
rsMaster_numRows = 0
%>
<%
Dim rsCurSub__MMColParam
rsCurSub__MMColParam = "1"
If (Request.QueryString("fSubject") <> "") Then
rsCurSub__MMColParam = Request.QueryString("fSubject")
End If
%>
<%
set rsCurSub = Server.CreateObject("ADODB.Recordset")
rsCurSub.ActiveConnection = MM_Myconn_STRING
rsCurSub.Source = "SELECT * FROM tBBSSubject WHERE fSubject = " + Replace(rsCurSub__MMColParam, "'", "''") + ""
rsCurSub.CursorType = 0
rsCurSub.CursorLocation = 2
rsCurSub.LockType = 3
rsCurSub.Open()
rsCurSub_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsSubject_numRows = rsSubject_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Repeat2__numRows = -1
Dim Repeat2__index
Repeat2__index = 0
rsMaster_numRows = rsMaster_numRows + Repeat2__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
if (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
if (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End if
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
if (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End if
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
if (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End if
End Function
%>
<html>
<head>
<title>发布新贴</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../cjluntan/css/common.css" type="text/css">
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<link rel="stylesheet" href="../../css/common.css" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(images/bg1.gif);
}
-->
</style></head>
<body bgcolor="#FFFFE6" text="#000000" leftmargin="50">
<img src="images/tiaoshang.gif" width="705" height="24">
<table width="87%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="436" width="17%" valign="top">
<table width="93%" border="0" cellspacing="0" cellpadding="0" bgcolor="#3399CC">
<tr>
<td height="49" bgcolor="#FFFFCC">
<div align="left"><font color="#35B5D0" size="2">欢迎</font><font size="2"><font color="#5189FF"><%= Session("MM_Username") %></font><font color="#35B5D0">光临!</font><br>
<font color="#35B5D0">共有</font><font color="#5189FF"><%= Application("visits") %></font><font color="#35B5D0">人访问过我们的网站。</font><br>
<font color="#35B5D0">目前有</font><font color="#5189FF"><%= Application("Active") %></font><font color="#35B5D0">人在线。</font></font><br>
</div>
</td>
</tr>
<tr>
<td height="49" bgcolor="#FFFFCC">
<div align="center"><a href="<%= MM_Logout %>" class="txtfld"><font color="#FF3399" size="2">退出登录</font></a></div>
</td>
</tr>
</table>
</td>
<td width="83%" height="436" valign="top" bgcolor="#DFF4FF">
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="40" bordercolor="#000000" bgcolor="#66CCFF" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#DFF4FF">
<td width="14%" bgcolor="#DFF4FF">
<div align="center"><font color="#35B5D0" size="2">讨论区主题</font></div>
</td>
<td width="48%" bgcolor="#DFF4FF">
<div align="left">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsSubject.EOF))
%>
<font color="#5189FF" size="2"><a href="default.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "fSubject=" & rsSubject.Fields.Item("fSubject").Value %>" class="txtfld"><%=(rsSubject.Fields.Item("fName").Value)%></a></font>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsSubject.MoveNext()
Wend
%>
<font color="#5189FF">
<% if rsSubject.EOF And rsSubject.BOF Then %>
<font size="2">暂无主题</font>
<% End if ' end rsSubject.EOF And rsSubject.BOF %>
</font> </div>
</td>
<td width="19%" rowspan="2" bgcolor="#DFF4FF">
<div align="center"></div>
<div align="center"><font color="#35B5D0" size="2">当前讨论区主题</font></div>
</td>
<td width="19%" rowspan="2" bgcolor="#DFF4FF">
<div align="center"><font color="#5189FF" size="2"><%=(rsCurSub.Fields.Item("fName").Value)%></font></div>
</td>
</tr>
<tr>
<td width="14%" bgcolor="#DFF4FF">
<div align="center"><font color="#35B5D0" size="2">当前版主</font></div>
</td>
<td width="48%" bgcolor="#DFF4FF">
<div align="left">
<%
While ((Repeat2__numRows <> 0) AND (NOT rsMaster.EOF))
%>
<a href="ShowPersonal.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "fPoster=" & rsMaster.Fields.Item("fUserID").Value %>" target="_blank"><font color="#5189FF" size="2"><%=(rsMaster.Fields.Item("fUserID").Value)%></font> </a>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rsMaster.MoveNext()
Wend
%>
<% if rsMaster.EOF And rsMaster.BOF Then %>
<font color="#5189FF" size="2">暂无版主 </font>
<% End if ' end rsMaster.EOF And rsMaster.BOF %>
</div>
</td>
</tr>
</table>
<form ACTION="<%=MM_editAction%>" name="frmPost" method="POST" onSubmit="MM_validateForm('fTitle','','R','fContent','','R');return document.MM_returnValue">
<table border=1 cellspacing="0" cellpadding="4" bordercolorlight="#000000" bordercolordark="#FFFFFF" width="100%">
<tbody>
<tr>
<td width=13 align="right" valign="middle" bgcolor="#66CCFF"> <div align=center><font color="#CCCC66"><font color="#35B5D09" size="2">发贴主题</font></font>
</div></td>
<td width=603 bgcolor="#66CCFF">
<div align="left">
<input name="textfield" type="text" size="50">
</div></td>
</tr>
<tr>
<td width=13 align="right" valign="middle" bgcolor="#66CCFF"> <div align=center><font color="#CCCC66"><font color="#35B5D0" size="2">详细内容</font></font></div></td>
<td width=603 bgcolor="#66CCFF">
<div align="left">
<p>
<textarea name="textarea" cols="70" rows="25"></textarea>
</p>
<p align="center">
<input type="hidden" name="fIP" value="<%=Request.SerVerVariables("REMOTE_ADDR")%>">
<input type="hidden" name="fPoster" value="<%= Session("MM_Username") %>">
<input type="hidden" name="fSubject" value="<%=Request.Querystring("fSubject")%>">
</p>
</div></td>
</tr>
<tr bgcolor="#66CCFF">
<td height="31" colspan="2" align=right valign="top" bgcolor="#66CCFF">
<div align="center">
<input title=写完了,用这个提交到论坛,便于他人访问 type=submit value=" 发 贴 " name="submit">
<input type=reset value=" 重 写 " name="reset">
</div></td>
</tr>
</tbody>
</table>
<input type="hidden" name="MM_insert" value="frmPost">
</form>
</td>
</tr>
</table>
<img src="images/tiaoxia.gif" width="704" height="26">
</body>
</html>
<%
rsSubject.Close()
%>
<%
rsMaster.Close()
%>
<%
rsCurSub.Close()
Set rsCurSub = Nothing
%>