Bob Schneider
asked on
Custom Error Page Filter
I have a custom 404 error page that is working well. it sends me emails when a page is not found but I want to filter the errors that it sends me so I have created an array and if the error matches one of the array items it doesn't send. Here are the ones I am trying to filter:
DontSend(0) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-57x57-precomposed.png"
DontSend(1) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png"
DontSend(2) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-57x57.png"
DontSend(3) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon.png"
DontSend(4) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-114x114-precomposed.png"
DontSend(5) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-144x144-precomposed.png"
DontSend(6) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-72x72-precomposed.png"
DontSend(7) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png"
DontSend(8) = "Query String: 404;http://www.etraxc.com:80/graphics/warning_lights/yellow.gif"
DontSend(9) = "Query String: 404;http://www.etraxc.com:80/graphics/warning_lights/red.gif"
DontSend(10) = "Query String: 404;http://www.etraxc.com:80/verify.authorize.net/anetseal/seal.js"
DontSend(11) = "Query String: 404;http://www.etraxc.com:80/crossdomain.xml"
bDontSend = False
If Trim(ErrArray(2)) & "" = "" Then bDontSend = True
If bDontSend = False Then
For i = 0 To UBound(DontSend)
If Trim(ErrArray(10)) = DontSend(i) Then
bDontSend = True
Exit For
End If
Next
End If
Unfortunately many of them are still coming through. Here is an example of what I get in my error report email:
Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png
Any idea as to what I am missing???
DontSend(0) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-57x57-precomposed.png"
DontSend(1) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png"
DontSend(2) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-57x57.png"
DontSend(3) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon.png"
DontSend(4) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-114x114-precomposed.png"
DontSend(5) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-144x144-precomposed.png"
DontSend(6) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-72x72-precomposed.png"
DontSend(7) = "Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png"
DontSend(8) = "Query String: 404;http://www.etraxc.com:80/graphics/warning_lights/yellow.gif"
DontSend(9) = "Query String: 404;http://www.etraxc.com:80/graphics/warning_lights/red.gif"
DontSend(10) = "Query String: 404;http://www.etraxc.com:80/verify.authorize.net/anetseal/seal.js"
DontSend(11) = "Query String: 404;http://www.etraxc.com:80/crossdomain.xml"
bDontSend = False
If Trim(ErrArray(2)) & "" = "" Then bDontSend = True
If bDontSend = False Then
For i = 0 To UBound(DontSend)
If Trim(ErrArray(10)) = DontSend(i) Then
bDontSend = True
Exit For
End If
Next
End If
Unfortunately many of them are still coming through. Here is an example of what I get in my error report email:
Query String: 404;http://www.etraxc.com:80/apple-touch-icon-precomposed.png
Any idea as to what I am missing???
ASKER
ErrArray(1) = " Organization: " & Session("team_name") & " " & vbCrLf
ErrArray(2) = " Site User: " & sMyName & " " & vbCrLf
ErrArray(3) = " Role: " & Session("role") & " " & vbCrLf
ErrArray(4) = " Email: " & Session("my_email") & " " & vbCrLf
ErrArray(5) = " When Occur: " & Now() & " " & vbCrLf
ErrArray(6) = " Web Page: " & "//" & Request.ServerVariables ("SERVER_NAME") & ASPErr.File & " " & vbCrLf
ErrArray(7) = " URL: " & Request.ServerVariables("U RL") & " " & vbCrLf
ErrArray(8) = " LOCAL_ADDR: " & Request.ServerVariables("L OCAL_ADDR" ) & " " & vbCrLf
ErrArray(9) = " REMOTE_ADDR: " & Request.ServerVariables("R EMOTE_ADDR ") & " " & vbCrLf
ErrArray(10) = " Query String: " & Request.QueryString & " " & vbCrLf
ErrArray(11) = " Form: " & Request.Form
ErrArray(2) = " Site User: " & sMyName & " " & vbCrLf
ErrArray(3) = " Role: " & Session("role") & " " & vbCrLf
ErrArray(4) = " Email: " & Session("my_email") & " " & vbCrLf
ErrArray(5) = " When Occur: " & Now() & " " & vbCrLf
ErrArray(6) = " Web Page: " & "//" & Request.ServerVariables ("SERVER_NAME") & ASPErr.File & " " & vbCrLf
ErrArray(7) = " URL: " & Request.ServerVariables("U
ErrArray(8) = " LOCAL_ADDR: " & Request.ServerVariables("L
ErrArray(9) = " REMOTE_ADDR: " & Request.ServerVariables("R
ErrArray(10) = " Query String: " & Request.QueryString & " " & vbCrLf
ErrArray(11) = " Form: " & Request.Form
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good save! Thanks!!
GH