javascript - How to determine error if IIS 6 is redirecting to a different page based on error? -


ok, might seem confusing, basically, this:

there's form on asp page (not .net), sends info ms sql 2000 based server, running on iis6 (i think, might iis 5.1). server configured accept digits, form not validated.

so when user keys in alphabets, , submits, error displayed. have configured iis redirect different page based on http error code, ("sorry, page requested cannot loaded @ time"), i, developer, don't know error code about.

is there way can configure error page 'onload' send email containing page address caused error, error message itself, time of error, current user that's logged in, etc.? i'm open solutions, client side javascript, or server side asp code... iis configs valid answers now.. lol...

in iis, custom errors tab > change 500 error type url file 'error.asp'

in error.asp, loop form, querystring , session elements , send error details home in on error.

    dim asperr ,asperrstr,intkey   dim strquerystringelement,strquerystringvalue,strcurrentquerystring   dim strformelement,strformvalue,strcurrentform       dim strsesselement,strsessvalue,strcurrentsess   set asperr = server.getlasterror()    asperrstr = ""   asperrstr = asperrstr&vbcrlf&"aspcode: "&asperr.aspcode   asperrstr = asperrstr&vbcrlf&"aspdescription: "&asperr.aspdescription   asperrstr = asperrstr&vbcrlf&"category: "&asperr.category   asperrstr = asperrstr&vbcrlf&"column: "&asperr.column   asperrstr = asperrstr&vbcrlf&"description: "&asperr.description   asperrstr = asperrstr&vbcrlf&"file: "&asperr.file   asperrstr = asperrstr&vbcrlf&"line: "&asperr.line   asperrstr = asperrstr&vbcrlf&"number: "&asperr.number   asperrstr = asperrstr&vbcrlf&"source: "&asperr.source    each intkey in request.querystring     strquerystringelement = request.querystring.key(intkey)     strquerystringvalue = request.querystring.item(strquerystringelement)              strcurrentquerystring = strcurrentquerystring & "element: "& _      strquerystringelement & ".........value: " &strquerystringvalue& vbcrlf next  each intkey in request.form     strformelement = request.form.key(intkey)     strformvalue = request.form.item(strformelement)              strcurrentform =    strcurrentform & "element: "& _      strformelement & ".........value: " &strformvalue&vbcrlf next  each intkey in session.contents     strsesselement = intkey     strsessvalue = session(intkey)     strcurrentsess =    strcurrentsess & "element: "& _      strsesselement & ".........value: " &strsessvalue& vbcrlf next  asperrstr = asperrstr&vbcrlf&"querystring: " asperrstr = asperrstr&vbcrlf&strcurrentquerystring asperrstr = asperrstr&vbcrlf&"form: " asperrstr = asperrstr&vbcrlf&strcurrentform asperrstr = asperrstr&vbcrlf&"session: " asperrstr = asperrstr&vbcrlf&strcurrentsess  set mymail=createobject("cdo.message") mymail.subject="error" mymail.from="someone@address.com" mymail.to="someoneelse@address.com" mymail.textbody= asperrstr mymail.configuration.fields.item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 'name or ip of remote smtp server mymail.configuration.fields.item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtpserveraddress" 'server port mymail.configuration.fields.item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25  mymail.configuration.fields.update mymail.send set mymail=nothing   %>  

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -