<%@LANGUAGE="VBSCRIPT"%> <% ' *** Edit Operations: declare variables MM_editAction = CStr(Request("URL")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Request.QueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Redirect if username exists MM_flag="MM_insert" If (CStr(Request(MM_flag)) <> "") Then MM_dupKeyRedirect="register.asp" MM_rsKeyConnection=MM_reg2RS_STRING MM_dupKeyUsernameValue = CStr(Request.Form("email")) MM_dupKeySQL="SELECT email FROM customers WHERE email='" & MM_dupKeyUsernameValue & "'" MM_adodbRecordset="ADODB.Recordset" set MM_rsKey=Server.CreateObject(MM_adodbRecordset) MM_rsKey.ActiveConnection=MM_rsKeyConnection MM_rsKey.Source=MM_dupKeySQL MM_rsKey.CursorType=0 MM_rsKey.CursorLocation=2 MM_rsKey.LockType=3 MM_rsKey.Open If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then ' the username was found - can not add the requested username MM_qsChar = "?" If (InStr(1,MM_dupKeyRedirect,"?") >= 1) Then MM_qsChar = "&" MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue Response.Redirect(MM_dupKeyRedirect) End If MM_rsKey.Close End If %> <% ' *** Insert Record: set variables If (CStr(Request("MM_insert")) <> "") Then MM_editConnection = MM_reg2RS_STRING MM_editTable = "customers" MM_editRedirectUrl = "thank_you2.asp" MM_fieldsStr = "access_level|value|fname|value|lname|value|email|value|password|value|home_street|value|home_city|value|home_state|value|home_zip|value|area|value|phone|value|pro_license|value|salon_name|value|salon_street|value|salon_city|value|salon_state|value|salon_zip|value" MM_columnsStr = "access_level|none,none,NULL|fname|',none,''|lname|',none,''|email|',none,''|password|',none,''|home_street|',none,''|home_city|',none,''|home_state|',none,''|home_zip|none,none,NULL|area_code|none,none,NULL|phone|',none,''|pro_license|',none,''|salon_name|',none,''|salon_street|',none,''|salon_city|',none,''|salon_state|',none,''|salon_zip|',none,''" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(i+1) = CStr(Request.Form(MM_fields(i))) Next ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If End If %> <% ' *** Insert Record: construct a sql insert statement and execute it If (CStr(Request("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For i = LBound(MM_fields) To UBound(MM_fields) Step 2 FormVal = MM_fields(i+1) MM_typeArray = Split(MM_columns(i+1),",") Delim = MM_typeArray(0) If (Delim = "none") Then Delim = "" AltVal = MM_typeArray(1) If (AltVal = "none") Then AltVal = "" EmptyVal = MM_typeArray(2) If (EmptyVal = "none") Then EmptyVal = "" If (FormVal = "") Then FormVal = EmptyVal Else If (AltVal <> "") Then FormVal = AltVal ElseIf (Delim = "'") Then ' escape quotes FormVal = "'" & Replace(FormVal,"'","''") & "'" Else FormVal = Delim + FormVal + Delim End If End If If (i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End if MM_tableValues = MM_tableValues & MM_columns(i) MM_dbValues = MM_dbValues & FormVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% set regRS = Server.CreateObject("ADODB.Recordset") regRS.ActiveConnection = MM_reg2RS_STRING regRS.Source = "SELECT * FROM customers" regRS.CursorType = 0 regRS.CursorLocation = 2 regRS.LockType = 3 regRS.Open() regRS_numRows = 0 %> RMD Products - Professional Registeration
< home apply for employment
Shop On-line Now! Store Now Open

  <% IF (Request.Querystring("requsername") <> ("")) then %> The username <%=Request.Querystring("requsername")%> already exists, please enter a different name, or login to the Professional Area. <% End If %>
Professional Area Registration
Register below for exciting news, discounts, and other professional stuff from RMD Products:
Your Personal Information
First Name:
Last Name:
  Below will be your login information for the professional area. please choose a password you can remember.
E-Mail:
Password:
Street Address:
City:
State:
Zip:
Area Code:
Phone Number:
  Your Professional Information
Professional License Number:
  In order to recieve discounts on our professional products, we must have your correct License Number. When you place your first order with RMD Products, we will verfiy this number before processing your order with the discount price.
Salon Name:
Salon Street:
Salon City:
Salon State:
Salon Zip:
   
   

 

 

If you have a question or problem with this form, please click here.
Copyright © 2002, RMD Products Co. Design - JSWilton Consulting
<% regRS.Close() %>