Below is a slightly more advanced script to deal with an error. It uses an include file which you should put in the same folder as the page that calls it or if you know how to use a virtual include then work that way.
<html>
<head>
<title>Error Handling</title>
</head>
<body>
<!--#include file="error_checker.asp"-->
<%
respons.write ("this will produce an error as there is a
mispelling")
ErrorCheck() 'this
calls the function which will check if there is an error
'you
can call this function anywhere on your page
'it
will only check errors in the previous code
%>
</body>
</html>
Ok so now we will write the include file that will hold the Errorcheck funtion and deal with any errors encountered in the code.
Below is the file that should be called error_checker.asp
<%
On Error Resume Next
Function ErrorCheck()
If Err.Number<>0 then 'if
there is an error then the html table will be written out
%>
<table width="80%" border="0" align="center">
<tr>
<td>Error is <%= Err.description%> and
Error no. is <%=Err.number%>
</td>
</tr>
<tr>
<td>Please report the error to our webmaster
@ <a href="mailto:webmaster@codefixer.com">webmaster@codefixer.com</a>
</td>
</tr>
</table>
<%
End If
End Function
%>
Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.
Get your best asp web hosting provider now and save 25%