We help IT Professionals succeed at work.

Response.end question

iptrader
iptrader asked
on
460 Views
Last Modified: 2006-11-17
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
%>
Comment
Watch Question

Top Expert 2004

Commented:
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
Top Expert 2004
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Nice answer.  Thanks for your help!

Best,

IPT
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.