Verify your members
page 4 of 4
by Philip Q
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 19569/ 136

The Validation

The actual validation

Now that the email has been sent and the user has been added to the database, they need to be authorized.

Form Name : AuthUser
EM AU
Email Authorization Code

 
<%
Dim email, aucode, objConn, objRS
email = Request.Form("EM")
aucode = Request.Form("AU")
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.RecordSet")
objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\domains\aspalliance.com\wisemonk\authuser\users.mdb")
objRS.ActiveConnection = objConn
objRS.Source = "SELECT status FROM users WHERE email = '" & email & "'"
objRS.LockType = 3
objRS.Open()

If objRS.EOF Then
Response.Write("There is no user with that email in the database")
Else
If objRS.Fields.Item("status").Value = aucode Then
objRS.Fields("status") = "V"
objRS.Update
Response.Write("User Validated")
Else
Response.Write("Incorrect auth code")
End If
End If

objConn.Close()
Set objConn = Nothing
Set objRS = Nothing
%>

  • Just like before it gets the form values, opens the db connection and fills the recordset.
  • It then checks the recordset for records (to see if the email exists).
  • Then it checks the auth code against the database.
  • If both check out then the user is validated, otherwise an error is displayed.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 7/19/2008 10:56:55 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search