Código PHP:
<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>
<%Response.Buffer=True%>
<% On Error Resume Next %>
<head>
</head>
<body>
Algo de texto...
<%
Call Conexion
Call Registro (rs)
SQL="Select ..... "
rs.Open SQL ....
If Err <> 0 then
Response.Clear ' Limpio buffer
Call AvisoError ' Llamo al sub
Err.Clear '
End If
On Error GoTo 0
' =================== SUB ==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-15">
<!-Hoja de estilos -->
<link rel="STYLESHEET" type="text/css" media="all" href="./estilos_01.css">
</head>
<body class="body">
<table border="0px" bgcolor="#b6b6b6" border="0px" cellpadding="0px" cellspacing="1px" width="400px">
<tr>
<td>
Mensaje para el cliente
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
'Cierro todas las conexiones
Call LimpiarRS (rs)
Call LimpiarConexion
' Detengo proceso y devuelvo el contenido del buffer
Response.End
%>
</body>
</html>