?? 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 + -