📄 msg_look.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%if Session("MM_Username")="" then Response.Write "<script Language=Javascript>alert('您已空闲时间超过5分钟或尚未登陆。');location.href = 'javascript:close();';</script>"%>
<!--#include file="myzb.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Delete Record: declare variables
if (CStr(Request("MM_delete")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_myzb_STRING
MM_editTable = "ms"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "msgok.asp"
' 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
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form2" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_myzb_STRING
MM_editTable = "ms"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "msgok.asp"
MM_fieldsStr = "hiddenField|value"
MM_columnsStr = "zt|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_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
%>
<%
' *** Delete Record: construct a sql delete statement and execute it
If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql delete statement
MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the delete
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
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
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
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
Recordset1__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_myzb_STRING
Recordset1.Source = "SELECT * FROM ms WHERE id = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=(Recordset1.Fields.Item("title").Value)%></title>
<style type="text/css">
.mm_botton{
border-top: #c4cccc 3px double;
border-right: #acb5b5 3px double;
border-bottom: #6f7777 3px double;
border-left: #acb5b5 3px double;
background: #fefefe url(images/background_form_element.gif) repeat-x;
font:12px tahoma;
padding-top:5px;
padding-bottom:5px;
padding-left:10px;
padding-right:10px;
text-decoration: none;
color:#666666;
}
.mm_botton:link{
color:#666666;
}
.mm_botton:hover{
border-top: #aedf9a 3px double;
border-right: #94da78 3px double;
border-bottom: #6ab94b 3px double;
border-left: #94da78 3px double;
text-decoration:none;
color:#999999;
}
<!--
body {
background-image: url(images/bg.gif);
}
.style1 {
font-size: xx-large;
font-weight: bold;
}
body,td,th {
font-size: 12px;
}
.style2 {font-size: 12px}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style></head>
<body>
<table width="379" border="1" align="center">
<tr>
<td width="22%" align="left" valign="middle"><div align="right">标题</div></td>
<td align="left" width="78%"><%=(Recordset1.Fields.Item("title").Value)%></td>
</tr>
<tr>
<td width="22%" align="left" valign="middle"><div align="right">内容</div></td>
<td align="left" width="78%"><%=(Recordset1.Fields.Item("ms").Value)%></td>
</tr>
<tr>
<td width="22%" align="left" valign="middle"><div align="right">发送者</div></td>
<td align="left" width="78%"><%=(Recordset1.Fields.Item("fsr").Value)%></td>
</tr>
<tr>
<td width="22%" align="left" valign="middle"><div align="right">发送时间</div></td>
<td align="left" width="78%"><%=(Recordset1.Fields.Item("ftime").Value)%></td>
</tr>
</table>
<div align="center">
<table width="375" border="0">
<tr>
<th width="125" scope="col"><form name="form1" method="POST" action="<%=MM_editAction%>">
<div align="center">
<input name="so" type="hidden" id="so" value="<%=(Recordset1.Fields.Item("id").Value)%>">
<input name="Submit" type="submit" class="mm_botton" value="删除">
<input type="hidden" name="MM_delete" value="form1">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">
</div>
</form></th>
<th width="125" scope="col"><form name="form2" method="POST" action="<%=MM_editAction%>">
<input name="hiddenField" type="hidden" value="2">
<input name="Submit" type="submit" class="mm_botton" value="返回">
<input type="hidden" name="MM_update" value="form2">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">
</form></th>
<th width="125" scope="col"><form name="form3" method="post" action="fmsg.asp">
<input name="b6" type="hidden" id="b6" value="<%=(Recordset1.Fields.Item("fsr").Value)%>">
<input name="Submit" type="submit" class="mm_botton" value="回复">
</form></th>
</tr>
</table>
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -