📄 function.asp
字号:
<%
Function ChkPost
'判断提交是否来自外部
Dim Server_V1,Server_V2
ChkPost=False
Server_V1=Cstr(Request.ServerVariables("HTTP_REFERER"))
Server_V2=Cstr(Request.ServerVariables("SERVER_NAME"))
If Mid(Server_V1,8,Len(Server_V2))<>Server_V2 Then
ChkPost=False
Else
ChkPost=True
End If
End Function
'分页函数
Function PageList (iPageValue,iRetCount,iCurrentPage,FieldName,FieldValue)
Dim Url
Dim PageCount '页总数
Dim PageRoot '页列表头
Dim PageFoot '页列表尾
Dim OutStr
Dim i '输出字符串
Url=URLStr(FieldName,FieldValue)
If (iRetCount Mod iPageValue)=0 Then
PageCount= iRetCount \ iPageValue
Else
PageCount= (iRetCount \ iPageValue)+1
End If
If iCurrentPage-4<=1 Then
PageRoot=1
Else
PageRoot=iCurrentPage-4
End If
If iCurrentPage+4>=PageCount Then
PageFoot=PageCount
Else
PageFoot=iCurrentPage+4
End If
OutStr="分页:"&iCurrentPage&"/"&PageCount&"页 总记录数:"& iRetCount &" "
If PageRoot=1 Then
If iCurrentPage=1 Then
OutStr=OutStr&"<font color=888888 face=webdings>9</font></a>"
OutStr=OutStr&"<font color=888888 face=webdings>7</font></a> "
Else
OutStr=OutStr&"<a href='?page=1"
OutStr=OutStr&Url
OutStr=OutStr&"' title=""首页""><font face=webdings>9</font></a>"
OutStr=OutStr&"<a href='?page="&iCurrentPage-1
OutStr=OutStr&Url
OutStr=OutStr&"' title=""上页""><font face=webdings>7</font></a> "
End If
Else
OutStr=OutStr&"<a href='?page=1"
OutStr=OutStr&Url
OutStr=OutStr&"' title=""首页""><font face=webdings>9</font></a>"
OutStr=OutStr&"<a href='?page="&iCurrentPage-1
OutStr=OutStr&Url
OutStr=OutStr&"' title=""上页""><font face=webdings>7</font></a>..."
End If
For i=PageRoot To PageFoot
If i=Cint(iCurrentPage) Then
OutStr=OutStr&"<font color='red'>["+Cstr(i)+"]</font> "
Else
OutStr=OutStr&"<a href='?page="&Cstr(i)
OutStr=OutStr&Url
OutStr=OutStr&"'>["+Cstr(i)+"]</a> "
End If
If i=PageCount Then Exit For
Next
If PageFoot=PageCount Then
If Cint(iCurrentPage)=Cint(PageCount) Then
OutStr=OutStr&"<font color=888888 face=webdings>8</font></a>"
OutStr=OutStr&"<font color=888888 face=webdings>:</font></a>"
Else
OutStr=OutStr&"<a href='?page="&iCurrentPage+1
OutStr=OutStr&Url
OutStr=OutStr&"' title=""下页""><font face=webdings>8</font></a>"
OutStr=OutStr&"<a href='?page="&PageCount
OutStr=OutStr&Url
OutStr=OutStr&"' title=""尾页""><font face=webdings>:</font></a>"
End If
Else
OutStr=OutStr&"... <a href='?page="&iCurrentPage+1
OutStr=OutStr&Url
OutStr=OutStr&"' title=""下页""><font face=webdings>8</font></a>"
OutStr=OutStr&"<a href='?page="&PageCount
OutStr=OutStr&Url
OutStr=OutStr&"' title=""尾页""><font face=webdings>:</font></a>"
End If
OutStr=OutStr&" <INPUT TYPE=text class=TextInput size=3 value="&iCurrentPage&" onmouseover='this.focus();this.select()' NAME=PGNumber> <INPUT TYPE=button id=button name=button class=btnA value=GO onclick="&""""&"if(document.all.PGNumber.value>0 && document.all.PGNumber.value<="&PageCount&"){window.location='?Page='+document.all.PGNumber.value+'"&Url&"'}"&""""&" onmouseover='this.focus()' onfocus='this.blur()'>"
PageList=OutStr
End Function
'取得Url参数
Function URLStr(FieldName,FieldValue)
Dim i
For i=0 to Ubound(FieldName)
URLStr=URLStr&"&"&Cstr(FieldName(i))&"="&Cstr(FieldValue(i))
Next
End Function
'安全取得Url能数
Function SafeRequest(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)
If ParaType=1 Then
If Not isNumeric(ParaValue) Then
sysErr(9)
End If
Else
ParaValue=replace(ParaValue,"'","''")
End if
SafeRequest=ParaValue
End function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -