Link to home
Start Free TrialLog in
Avatar of iptrader
iptrader

asked on

Response.end question

I am using this form to validate and enter data to a table.  The only problem I have is when the email address is duplicated, right after the error message triggers, the footer in my page will not load due to response.end.  Is there a workaround for this?

Thanks in advance,

IPT


<!--#include file="dsn.asp"-->
<%

Dim sSQL
sSQL = "SELECT * FROM Users where Email =  '" & Request.Form("Email") & "'"

Set Rs = Conn.Execute(sSQL)

If Not rs.EOF Then
 response.Write "This e-mail address has already been registered. Please register a different e-mail address"
 response.end
Else
 response.write "Success!  Your account has been registered"
End If

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Users", Conn, 2, 2

RS.addnew
RS("Name") = request("Name")
RS("Email") = request("Email")
RS("Password") = request("Password")

RS.update
RS.close
set RS = nothing

Conn.Close
Set Conn = Nothing
%>
Avatar of alorentz
alorentz
Flag of United States of America image

If Not rs.EOF Then
 session("error") = "This e-mail address has already been registered. Please register a different e-mail address"
 response.redirect "previouspage.asp" 'then show error message there
 response.end
Else
 response.write "Success!  Your account has been registered"
End If
ASKER CERTIFIED SOLUTION
Avatar of alorentz
alorentz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of iptrader
iptrader

ASKER

Nice answer.  Thanks for your help!

Best,

IPT