<% Call Main '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Sub Main ' ' Processing for this page starts in this routine. It ' contains a dispatcher to call the appropriate routine, ' based on what function was needed. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Dim cnDB set cnDB = OpenDB() Select Case Request(ACTION) Case ACTION_CREATE_SAVE CreateSave cnDB Case Else BuildForm cnDB, "" End Select End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Sub BuildForm ' ' This routine gets the Username and Password from the user. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub BuildForm(cnDB, strError) Dim lngContactID ' As Long Dim strAction Dim strTitle Dim datModDate Dim strFirstName Dim strLastName Dim strCurrLastName Dim strEmail Dim strKeepPrivate Dim strUserName Dim strPassword Dim strPassword2 strTitle = "Create Your Reunion Account" datModDate = Date() strPassword = "" strPassword2 = "" If strError = "" Then strAction = ACTION_CREATE_SAVE lngContactID = -1 strFirstName = "" strLastName = "" strCurrLastName = "" strEmail = "" strKeepPrivate = "" strUserName = "" Else strAction = ACTION_CREATE_SAVE If Request("ID") = "" Then lngContactID = -1 Else lngContactID = Request("ID") End If strFirstName = Request("dbtFirstName") strLastName = Request("dbtLastName") strCurrLastName = Request("dbtCurrLastName") strEmail = Request("dbtEmail") strKeepPrivate = Request("dbtKeepPrivate") strUserName = Request("dbtUserName") End If PrintHeader strTitle WL "

" If strError <> "" Then WL strError & "

" End If WL "

" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" PrintFooter End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Sub CreateSave ' ' This routine creates a new record in the database. ' ''''''''''''''''''''''''''''''''''''''''''''''''''' Sub CreateSave(cnDB) Dim strUserName Dim strPassword Dim rsData ' As ADODB.Recordset If Not ValidateData(cnDB) Then Exit Sub strUserName = Request("dbtUserName") strPassword = Request("dbtPassword") Set rsData = Server.CreateObject("ADODB.Recordset") rsData.Open "tblContacts", cnDB, adOpenDynamic, adLockOptimistic rsData.AddNew rsData("FirstName") = Request("dbtFirstName") rsData("LastName") = Request("dbtLastName") rsData("CurrLastName") = Request("dbtCurrLastName") rsData("Email") = Request("dbtEmail") rsData("KeepPrivate") = Request("dbtKeepPrivate") rsData("UserName") = Request("dbtUserName") rsData("Password") = Request("dbtPassword") ' rsData("ModDate") = Request("ModDate") rsData.Update rsData.Close Response.Cookies("Reunion")("UserName") = strUserName Response.Cookies("Reunion")("Password") = strPassword Response.Cookies("SysMod")("UserName") = strUserName Response.Cookies("SysMod")("Password") = strPassword Response.Cookies("Reunion").Expires = DateAdd("d", 5, date) PrintHeader "Account Created" WL "

Your account has now been created.

" WL "

Ideally you would now " WL "Update Your Account " WL "with all of the fun stuff like family, career, and high " WL "school memories. You can also go straight to the " WL "Classmates " WL "page to see what other classmates have been up to.

" WL "

Enjoy!

" WL "

" PrintFooter End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''' ' Function ValidateData ' ' This routine validates the input data and ' causes the form to be shown if the data is ' not correct. A True result indicates that ' the data was OK, and a False indicates that ' the data was in error. ' ''''''''''''''''''''''''''''''''''''''''''''''''''' Function ValidateData(cnDB) Dim strError ' As String strError = "" If Request("dbtLastName") = "" _ And Request("dbtFirstName") = "" Then strError = strError _ & "
  • Please enter your first name and " _ & " a last name." End If If Len(Request("dbtUserName")) < 4 Then strError = strError _ & "
  • Your Username must be at least 4 characters long." End If If Len(Request("dbtPassword")) < 4 Then strError = strError _ & "
  • Your Password must be at least 4 characters long." End If If Request("dbtPassword") <> Request("dbtPassword2") Then strError = strError _ & "
  • Your Passwords do not match. Please " _ & "re-enter your password and confirm it." End If If strError <> "" Then strError = "

    " _ & "The following data errors were detected:
    " _ & "

    " BuildForm cnDB, strError ValidateData = False Else ValidateData = True End If End Function %>
  • " WL "

    Please enter the following information to create your account.

    " WL "
    " WL "" WL "" ' WL "" WL "First Name:
    Last Name During High School:
    Current Last Name:
    Email Address:
    Keep Email Address Private **:
    Username:
    Password: Please do NOT use numbers or capital letters " _ & "in your password.
    Confirm Password:
    " WL "
    " WL "
    ** Choose No to allow classmates to see your email address.
    " WL "Choose Yes to allow only the system administrator to see it." WL "