📄 index.asp
字号:
<!--#include file="Conn.asp"-->
<%
'过滤代码
function HTMLEncode(fString)
If not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</p><p> ")
fString = Replace(fString, CHR(10), "<br> ")
HTMLEncode = fString
End If
End function
function UHTMLEncode(fString)
If not isnull(fString) then
fString = Replace(fString, " ", CHR(32))
fString = Replace(fString, " ", CHR(9))
fString = Replace(fString, """, CHR(34))
fString = Replace(fString, "'", CHR(39))
fString = Replace(fString, "", CHR(13))
fString = Replace(fString, "</p><p> ", CHR(10) & CHR(10))
fString = Replace(fString, "<br> ", CHR(10))
HTMLEncode2 = fString
End If
End function
'入库调用
dim mRs,Msg_name,Msg_info
If Request.Querystring("action")="Add" then
Msg_name=htmlencode(Request.form("Msg_name"))
Msg_info=htmlencode(Request.form("Msg_info"))
If Msg_name="" or Msg_info="" then
Response.Write "<script>alert('作者、短信内容必须填写!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Msg_name)>6 then
Response.Write "<script>alert('姓名请不要大于6个汉字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Msg_info)>150 or len(Msg_info)<5 then
Response.Write "<script>alert('短信内容请不要大于150个汉字小于5个汉字!');this.location.href='Index.asp';</SCRIPT>"
Else
Set mRs = Server.CreateObject("adodb.recordSet")
mRs.open "Select* from M_msg", conn, 1, 3
mRs.addnew
mRs("Msg_name") = Msg_name
mRs("Msg_info") = Msg_info
mRs("Msg_time") = now()
mRs.update
mRs.close
Set mRs = nothing
Response.Write "<script>alert('添加成功,站长将在24小时内为你审核,谢谢你对本站的支持,请继续关注本站!本站永久域名:http://www.wm126.com');this.location.href='Index.asp';</SCRIPT>"
Response.End
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><% =Title %></title>
<style type="text/css">
body,td,th {
font-size: 12px;
color: #2E2E2E;
line-height: 20px;
scrollbar-base-color:#CCCCCC;
scrollbar-face-color:#FFFFFF;
scrollbar-track-color:#FFFFFF;
scrollbar-arrow-color:#CCCCCC;
scrollbar-3dlight-color:#CCCCCC;
scrollbar-highlight-color:#CCCCCC;
scrollbar-shadow-color:#FFFFFF;
scrollbar-darkshadow-color:#000000;
}
a:link {
color: #2E2E2E;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #2E2E2E;
}
a:hover {
text-decoration: none;
color: #FF6600;
border-bottom-color: #FF6600;
}
.text{
font-size: 12px;
border: 1px solid #CCCCCC;
background-color: transparent;
}
.button {
font-size: 12px;
border: 1px solid #CCCCCC;
background-color: transparent;
width: 50px;
}
.buttonb {
font-size: 12px;
border: 1px solid #CCCCCC;
background-color: transparent;
width: 20px;
}
.input {
font-size: 12px;
border: 1px solid #CCCCCC;
background-color: transparent;
width: 180px;
}
.inputb {
font-size: 12px;
border: 1px solid #CCCCCC;
background-color: transparent;
width: 30px;
}
</style>
</head>
<body>
<table border="0" cellpadding="3" cellspacing="1" style="border-collapse: collapse" width="550" bgcolor="#CCCCCC" align="center">
<tr valign="top" bgcolor="#FFFFFF">
<td align="center">
<table border="0" cellpadding="3" style="border-collapse: collapse" width="100%">
<%
Sql="Select * from [M_msg] where Msg_validate=1 order by Msg_hit"
Set mRs=Server.CreateObject("adodb.recordSet")
mRs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
mRs.PageSize =13'每页记录条数
iCount=mRs.RecordCount '记录总数
iPageSize=mRs.PageSize
maxpage=mRs.PageCount
page=request("page")
If Not IsNumeric(page) or page="" then
page=1
Else
page=cint(page)
End If
If page<1 then
page=1
ElseIf page>maxpage then
page=maxpage
End If
mRs.AbsolutePage=Page
If page=maxpage then
x=iCount-(maxpage-1)*iPageSize
Else
x=iPageSize
End If
End If
i=1
for j=1 to mRs.pagesize
%>
<tr>
<td width="5" align="center"><% Response.Write(""&CStr(i)&"") %>、</td>
<td width="323"><a target="_blank" href="Indexlist.asp?id=<%=mRs("Id")%>"><%
If len(mRs("Msg_info"))>20 then
Response.Write left(mRs("Msg_info"),20)&""
Else
Response.Write mRs("Msg_info")
End if
%></a></td>
<td width="100">作者:<%
If mRs("Msg_name")= "" or IsNull(mRs("Msg_name")) then
Response.Write"管理员"
Else
Response.Write "<font color=#FF6600>"&mRs("Msg_name")&"</font>"
End If
%></td>
<td width="100">浏览:<% =mRs("Msg_hit") %></td>
</tr>
<tr bgcolor="#CCCCCC">
<td></td>
<td></td>
<td width="83"></td>
<td></td>
<td></td>
</tr>
<%
i=i+1
mRs.movenext
If mRs.eof then exit for
next
%>
</table>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
mRs.close
Set mRs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><tr>" & vbCrLf )
Response.Write("<td align=right>" & vbCrLf )
Response.Write(font_style & vbCrLf )
If page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
Else
Response.Write("<a href=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
End If
If page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页 " & vbCrLf)
Else
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<a href=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)
End If
Response.Write(" 页次:<b>" & page & "</b>/<b>" & pageCount & "</b> 页" & vbCrLf)
Response.Write(" 共有 <b>" & iCount & "</b> 条短信" & vbCrLf)
Response.Write(" 转到 " & "<input type=text name=page class=inputb maxlength=5 value=" & page & ">" & " 页" & vbCrLf & "<input type=submit class=buttonb value=GO>")
Response.Write("</tr></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%> <hr noshade size="1" color="#CCCCCC">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<form name="form1" method="post" action="?action=Add">
<tr>
<td width="50">作者:</td>
<td><input name="Msg_name" type="text" class="input">
<input type="submit" name="Submit2" value=" 添加 " class="button"></td>
</tr>
<tr>
<td>内容:</td>
<td>
<textarea name="Msg_info" rows="5" cols="67"></textarea></td>
</tr>
</form>
</table>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td height="10"></td>
</tr>
<tr>
<td><b>本站幽默短信特别声明:</b>因本站短信大部分来源与:网络、朋友发送、站长自写,如若转载请务必注明出处本站。短信版权归短信原始作者所有。如果本站转载的短信有版权问题请联系站长。站长将在收到通知后立刻删除!</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td align="center"><% =Copyright %></td>
</tr>
</table>
</body>
</html>
<%
mRs.close
Set mRs=nothing
conn.close
Set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -