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

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 





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


©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-08-09 12:40:22 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search