<%@LANGUAGE="VBScript"%> <% if request.cookies("TSR_userID") <> "" and request.cookies("TSR_userName") <> "" and request.cookies("TSR_userType") <> "" then response.redirect("member_details.asp") end if this_err = 0 this_message = "" if request.form("hdFlag") = "yes" then str_promo = DeQuote(request.form("text_promo")) str_hear = request.form("sel_hear") str_username = DeQuote(request.form("text_username")) str_password = request.form("text_password") str_confirm_password = request.form("text_confirm_password") str_firstname = DeQuote(request.form("text_firstname")) str_lastname = DeQuote(request.form("text_lastname")) str_age = DeQuote(request.form("text_age")) str_city = DeQuote(request.form("text_city")) str_country = request.form("sel_country") str_zip = DeQuote(request.form("text_zip")) str_region = request.form("sel_region") str_o_province = DeQuote(request.form("text_o_province")) str_email = DeQuote(request.form("text_email")) str_phone = DeQuote(request.form("text_phone")) str_alert_opt = request.form("ra_alert_opt") if len(str_username) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the username
  • " err_username = 1 else set rsGetShopDupUsername = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT shop_id " & _ "FROM scuba_shops " & _ "WHERE shop_username = '" & str_username & "'" 'response.write mySQL rsGetShopDupUsername.Open mySQL, conn, 2, 2 set rsGetPDupUsername = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT profile_id " & _ "FROM scuba_profile " & _ "WHERE profile_username = '" & str_username & "'" 'response.write mySQL rsGetPDupUsername.Open mySQL, conn, 2, 2 set rsGetIDupUsername = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT instructor_id " & _ "FROM scuba_instructors " & _ "WHERE instructor_username = '" & str_username & "'" 'response.write mySQL rsGetIDupUsername.Open mySQL, conn, 2, 2 if (not rsGetShopDupUsername.EOF) or (not rsGetPDupUsername.EOF) or (not rsGetIDupUsername.EOF) then this_err = 1 this_massage = this_massage & "
  • The username has be taken, please try with another
  • " err_username = 1 end if end if if len(str_password) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the password
  • " err_password = 1 elseif len(str_password) < 6 then this_err = 1 this_massage = this_massage & "
  • The password must be at least 6 characters
  • " err_password = 1 elseif len(str_confirm_password) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the confirm password
  • " err_confirm_password = 1 elseif str_password <> str_confirm_password then this_err = 1 this_massage = this_massage & "
  • The password and confirm password must be same, please try again.
  • " err_password = 1 err_confirm_password = 1 end if if len(str_hear) = 0 then this_err = 1 this_massage = this_massage & "
  • How did you hear about us?
  • " err_hear = 1 end if if len(str_firstname) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the firstname
  • " err_firstname = 1 end if if len(str_lastname) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the lastname
  • " err_lastname = 1 end if if len(str_zip) = 0 and (str_country = 1 or str_country = 2) then this_err = 1 this_massage = this_massage & "
  • Please type the zip/postal code
  • " err_zip = 1 end if str_latitude = 0 str_longitude = 0 if str_country = 0 then this_err = 1 this_massage = this_massage & "
  • Please select the country
  • " err_country = 1 elseif str_country = 1 and not isUSZipCode(str_zip)then this_err = 1 this_massage = this_massage & "
  • Please type a valid USA zip code as 5 digits
  • " err_zip = 1 elseif str_country = 2 and not isCanadianPostalCode(str_zip) then this_err = 1 this_massage = this_massage & "
  • Please type a valid Canadian postal code
  • " err_zip = 1 elseif str_country = 1 or str_country = 2 then if str_country = 1 then if len(str_zip) > 5 then my_str_zip = left(str_zip, 5) else my_str_zip = str_zip end if set rsGetPostal = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT postal_latitude, postal_longitude " & _ "FROM scuba_postal " & _ "WHERE postal_code = '" & my_str_zip & "'" 'response.write mySQL rsGetPostal.Open mySQL, conn, 2, 2 elseif str_country = 2 then my_str_zip = left(str_zip, 3) set rsGetPostal = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT postal_latitude, postal_longitude " & _ "FROM scuba_postal " & _ "WHERE postal_code LIKE '" & my_str_zip & "%'" 'response.write mySQL rsGetPostal.Open mySQL, conn, 2, 2 end if if rsGetPostal.EOF then if str_country = 1 then this_err = 1 this_massage = this_massage & "
  • Your Zip Code is not valid in the USA Zip code database, please check.
  • " err_zip = 1 end if if str_country = 2 then this_err = 1 this_massage = this_massage & "
  • Your Postal Code is not valid in the Canadian Postal Code database, please check
  • " err_zip = 1 end if else str_latitude = rsGetPostal.fields("postal_latitude") str_longitude = rsGetPostal.fields("postal_longitude") end if end if if str_region = 0 and (str_country = 1 or str_country = 2) then this_err = 1 this_massage = this_massage & "
  • Please select the state/province
  • " err_region = 1 end if if len(str_email) = 0 then this_err = 1 this_massage = this_massage & "
  • Please type the email address
  • " err_email = 1 elseif not isValidEmail(str_email) then this_err = 1 this_massage = this_massage & "
  • The email must be a valid email address
  • " err_email = 1 end if if str_alert_opt <> "yes" then this_err = 1 this_massage = this_massage & "
  • Please read the terms and conditions
  • " err_alert_opt = 1 end if if this_err = 0 then set rs = Server.CreateObject("ADODB.Recordset") mySQL = "INSERT INTO scuba_profile " & _ " ( " & _ " profile_promo, " & _ " profile_hear, " & _ " profile_username, " & _ " profile_password, " & _ " profile_firstname, " & _ " profile_lastname, " & _ " profile_age, " & _ " profile_city, " & _ " profile_country, " & _ " profile_zip, " if str_country = "1" or str_country = "2" then mySQL = mySQL & "profile_state, " else mySQL = mySQL & "profile_o_province, " end if mySQL = mySQL & _ " profile_email, " & _ " profile_alert_opt, " & _ " profile_divecast_user, " if str_latitude <> 0 and str_longitude <> 0 then mySQL = mySQL & "profile_latitude, " mySQL = mySQL & "profile_longitude, " end if mySQL = mySQL & _ " profile_reg_date " & _ " ) " & _ "VALUES (" & _ " '" & str_promo & "', " & _ " '" & str_hear & "', " & _ " '" & str_username & "', " & _ " '" & str_password & "', " & _ " '" & str_firstname & "', " & _ " '" & str_lastname & "', " & _ " '" & str_age & "', " & _ " '" & str_city & "', " & _ " " & str_country & ", " & _ " '" & str_zip & "', " if str_country = "1" or str_country = "2" then mySQL = mySQL & str_region & ", " else mySQL = mySQL & "'" & str_o_province & "', " end if mySQL = mySQL & _ " '" & str_email & "', " & _ " '" & str_alert_opt & "', " & _ " 1, " if str_latitude <> 0 and str_longitude <> 0 then mySQL = mySQL & str_latitude & ", " mySQL = mySQL & str_longitude & ", " end if mySQL = mySQL & _ " '" & mySQL_DateTime(now()) & "' " & _ " ) " 'response.write mySQL rs.Open mySQL, conn, 2, 2 set rsGetNo = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT MAX(profile_id) as this_profile_id FROM scuba_profile" 'response.write mySQL rsGetNo.Open mySQL, conn, 2, 2 str_user_id = rsGetNo.fields("this_profile_id") Set CM = Server.CreateObject("Persits.CryptoManager") Set Context = CM.OpenContext("", True) Set Hash_UN = Context.CreateHash Hash_UN.AddText str_username my_hash_username = Hash_UN Set Hash_PW = Context.CreateHash Hash_PW.AddText str_password my_hash_password = Hash_PW str_link = "http://" & Request.ServerVariables("SERVER_NAME") & "/members/membereActive.asp?id=" & hash_id(str_user_id) & "&u=" & my_hash_username & "&p=" & my_hash_password 'Getting email template--------------------------------------------- Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Dim objTextStream Set objTextStream = objFSO.OpenTextFile(Server.MapPath("\email_template\accountActivation.htm"), 1) str_email_body = objTextStream.ReadAll str_email_body = replace(str_email_body, "", str_username) str_email_body = replace(str_email_body, "", str_password) str_email_body = replace(str_email_body, "", str_link) EmailSending "info@divecaster.com", str_email, "The DiveCaster.com Account Activation", str_email_body, 0 str_submitted = 1 end if end if %> Welcome to DiveCaster - Where do you want to dive today?
     
    <%if str_submitted = 1 then%> <%else%> <%if this_err = 1 then %> <%end if%> " method="post" name="profile_form"> <%end if%>
    Your account has been created but it is not yet activated. An email message has been sent to the email address you provided containing your account information and a link you can use to activate your account.
    Error message:
    <%=this_massage%>
    = required fields
    1. Referring source
      Promo code:
    " <%if err_promo=1 then response.write "class=""formError""" end if%> />
    How did you hear about us?:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    2. Select a user name and password:
      Select a user name:
    ( your screen name)
    " <%if err_username=1 then response.write "class=""formError""" end if%> style="width:150px;"/>
     
      Select a password:
    (must be at least 6 characters)
    style="width:150px;" />
    Confirm password:
    (must be at least 6 characters)
    style="width:150px;" />
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    3. Contact Information:
         
      Your e-mail address:
    " <%if err_email=1 then response.write "class=""formError""" end if%> style="width:150px;" />
    Select your country:
    <% set rsGetCountry = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT * FROM scuba_countries ORDER BY country_id" rsGetCountry.Open mySQL, conn, 2, 2 %>
      First Name:
    " <%if err_firstname=1 then response.write "class=""formError""" end if%> style="width:150px;" />
    Last Name:
    " <%if err_lastname=1 then response.write "class=""formError""" end if%> style="width:150px;" />
      State/Prov:
    <%if this_err = 1 then set rsGetRegion = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT * FROM scuba_regions " & _ "WHERE country_id = " & str_country & " " & _ "ORDER BY region" rsGetRegion.Open mySQL, conn, 2, 2 %> <%else%>
    <%end if%>
    State/Prov:
      City:
    " style="width:150px;" />
    Zip/Postal Code:
    " <%if err_zip=1 then response.write "class=""formError""" end if%> style="width:150px;" />
      Age:
    " style="width:150px;" />
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      I agree to the terms and conditions . "no" then response.write "checked" end if%>> yes > no
       

     
    <%if str_country = "1" or str_country = "2" or str_country = "" then%> <%else%> <%end if%>