Verify your members
page 4 of 4
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24034/ 52

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
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\\wisemonk\authuser\users.mdb")
objRS.ActiveConnection = objConn
objRS.Source = "SELECT status FROM users WHERE email = '" & email & "'"
objRS.LockType = 3

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

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 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2023  |  Page Processed at 2023-10-01 12:38:57 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search