⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.asp

📁 实用的拍卖源码。适合个人建站学习使用。仅供学习参考
💻 ASP
字号:
<%
function errors(errorid)
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align=center>
  <tr>
    <td height="5"></td>
  </tr>
</table>
<table cellpadding=0 cellspacing=1 class=tablebg width=760 align=center>
<tr height=80px><td class=td align=center><font class=fred>出错了!<%=errorid%></font><br><br><a href=javascript:history.back(-1);>返回</a></td></tr>
</table>
<%
end function

function s_error(id)
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align=center>
  <tr>
    <td height="5"></td>
  </tr>
</table>
<table cellpadding=0 cellspacing=1 class=tablebg width=760 align=center>
<tr height=80px><td class=td align=center><font class=fred>出错了!没有找到与&nbsp;<%=name1%>&nbsp;有关的信息!</font><br><br><a href=javascript:history.back(-1);>返回</a></td></tr>
</table>
<%
end function
Function SQLVal(pvValue)
   Dim sTemp
   Select Case VarType(pvValue)
      Case 0, 1:
         SQLVal = "NULL"
      Case 2, 3, 4, 5, 6:
         SQLVal = "" & pvValue
      Case 8: 'String
         sTemp = Trim(pvValue)
         On Error Resume Next
         SQLVal = "" & CDbl(sTemp)
         If Err.Number <> 0 Then
            Err.Clear
            SQLVal = "NULL"
         End If
      Case 11:
         SQLVal = "" & Cint(pvValue)         
      Case Else
         SQLVal = "NULL"
   End Select
End Function
Function aspeasehtml( psValueName )
 Dim sTemp
   Select Case VarType(psValueName)
      Case 0, 1:
         sTemp = "NULL"
      Case 2, 3, 4, 5, 6:
         sTemp = "" & psValueName
         sTemp = Replace(sTemp, "'", "''")
         'SQLStr = sTemp 
      Case 7: 'DateTime
         sTemp = FormatDateTime(psValueName)
         sTemp = Replace(sTemp, "'", "''")
         'SQLStr = sTemp 
      Case 8: 'String
         sTemp = psValueName
         sTemp = Replace(sTemp, "'", "''")
	 'sTemp = Replace(sTemp, chr(10), "<br>")
         If Len(Trim(sTemp)) > 0 Then
            sTemp = sTemp 
         Else
            sTemp = "NULL"
         End If
      Case Else
         sTemp = "NULL"
   End Select
  
   sTemp = server.htmlencode(sTemp)
   aspeasehtml = sTemp
End Function

Function Rst( psValueName )
   Dim sTemp 
   sTemp = Request.Form("" & psValueName)
   If Len(Trim(sTemp)) = 0 Then
      sTemp = Request.QueryString("" & psValueName)
   End If
   Rst = sTemp
End Function
Function FVal(pvValue)
   Dim sTemp
   Select Case VarType(pvValue)
      Case 0, 1:
         FVal = 0
      Case 2, 3, 4, 5, 6:
         FVal = pvValue
      Case 8: 'String
         sTemp = Trim(pvValue)
         On Error Resume Next
         FVal = CDbl(sTemp)
         If Err.Number <> 0 Then
            Err.Clear
            FVal = 0
         End If
      Case Else
         FVal = 0
   End Select
End Function
Function SQLStr(pvValue)
   Dim sTemp
   Select Case VarType(pvValue)
      Case 0, 1:
         SQLStr = "NULL"
      Case 2, 3, 4, 5, 6:
         sTemp = "" & pvValue
         sTemp = Replace(sTemp, "'", "''")
         SQLStr = sTemp 
      Case 7: 'DateTime
         sTemp = FormatDateTime(pvValue)
         sTemp = Replace(sTemp, "'", "''")
         SQLStr = sTemp 
      Case 8: 'String
         sTemp = pvValue
         sTemp = Replace(sTemp, "'", "''")
         If Len(Trim(sTemp)) > 0 Then
            SQLStr = sTemp 
         Else
            SQLStr = "NULL"
         End If
      Case Else
         SQLStr = "NULL"
   End Select
End Function
'只允许正确的输入
function chk(input,t)
	if input="" then
		response.write "<script language=javascript>alert('出错了,没有指定查询关键字!');this.location.href='index.asp';</script>"
		response.end
	end if
	if t="id" then
       good_password_chars="0123456789"
	elseif t="char" then
       good_password_chars="_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	else
		response.write "<script language=javascript>alert('出错了,错误的CHECK函数调用!');this.location.href='index.asp';</script>"
		response.end	
	end if       
	chkid=true
       for i=1 to len(input)
          c=mid(input,I,1)
          if(InStr(good_password_chars,c)=0) then
               chkid=false
		response.write "<script language=javascript>alert('出错了,非法的参数赋值!');this.location.href='index.asp';</script>"
		response.end
               exit function
          end if
       next
end function
'错误的参数拒绝操作
function chk2(input)
       known_bad=array("select","insert","update","delete","drop","—","'")
       chk2=true
       for i=lbound(known_bad) to ubound(known_bad)
          if(instr(1,input,known_bad(i),vbtextcompare)<>0) then
             ck2=false
		response.write "<script language=javascript>alert('出错了,你出现了非法的操作,请立即停止!');this.location.href='index.asp';</script>"
		response.end
             exit function
          end if
       next
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -