<% '=================== 'make sure the data all matches up dim emailexist, error, error_msg set tigRS = Server.CreateObject("ADODB.Recordset") query = "SELECT id, user_name, email, unlock_key " & _ "FROM forum_user " & _ "WHERE " & _ "email = '" & SQLsafe(Request.QueryString("e")) & "'" & _ "and " & _ "unlock_key = '" & SQLsafe(Request.QueryString("n")) & "'" 'Response.Write("Query = [" & query & "]
") tigRS.Open query,DSN,1 if not tigRS.EOF then emailexist = true Response.Cookies("lvl")("forumid") = tigRS("id") Response.Cookies("lvl")("forumuser_name") = tigRS("user_name") Response.Cookies("lvl").expires = dateadd("yyyy",1,now()) else 'they ain't in the DB :[ error = true error_msg = error_msg & "
  • Your email address is not in the ..::LvL forum database or your unlock key number is incorrect - make sure the URL is the same as that in the email (it needs to be the FULL URL)
  • " end if tigRS.close if emailexist then '================= 'they want to subscribe!! - yayayay! set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) query = "update forum_user " & _ "set active = 1, last_login_date = getdate()" & _ "WHERE " & _ "email = '" & SQLsafe(Request.QueryString("e")) & "'" & _ "and " & _ "unlock_key = '" & SQLsafe(Request.QueryString("n")) & "'" 'Response.Write("Query = [" & query & "]
    ") tigCON.Execute(query) tigCON.close end if %> [ contact ] ..::LvL forums
    +---------------------

     

    <% if error then Response.Write("There was an error processing your request.
      "& error_msg &"
    ") else %>

    Welcome to the ..::LvL forum - you have successfully unlocked your account. You can now add topics to the forums

    Enjoy...

    <% end if %>