<% Const adOpenKeyset = 1 Const adLockOptimistic = 3 Dim strFirstLetter,strLetterCase Dim strCartId strCartId = Request("CartId") Dim strPWD1 strPWD1 = trim(Request.Form("PWD1")) Dim strPWD2 strPWD2 = trim(Request.Form("PWD2")) Dim strEmail strEmail = trim(Request.Form("Email")) DIM strCustNumber strCustNumber = Request.Form("CustNumber") Dim strFName strFName = trim(Request("FName")) strFName = Replace(strFName,Chr(034),"") strFirstLetter = Left(strFName,1) strLetterCase = Ucase (strFirstLetter) strFName = Replace(strFName,strFirstLetter,strLetterCase,1,1) Dim strMName strMName = trim(Request.Form("MName")) strMName = Replace(strMName,Chr(034),"") strFirstLetter = Left(strMName,1) strLetterCase = Ucase (strFirstLetter) strMName = Replace(strMName,strFirstLetter,strLetterCase,1,1) Dim strLName strLName = trim(Request.Form("LName")) strLName = Replace(strLName,Chr(034),"") strFirstLetter = Left(strLName,1) strLetterCase = Ucase (strFirstLetter) strLName = Replace(strLName,strFirstLetter,strLetterCase,1,1) Dim strCoName strCoName = trim(Request.Form("CoName")) strCoName = Replace(strCoName,Chr(034),"") strCoName = UCase(strCoName) Dim strActive strActive = Request.Form("Active") Dim strAddress strAddress = trim(Request.Form("Address")) strAddress = Replace(strAddress,Chr(034),"") strAddress = UCase(strAddress) Dim strAddress2 strAddress2 = trim(Request.Form("Address2")) strAddress2 = Replace(strAddress2,Chr(034),"") strAddress2 = UCase(strAddress2) Dim strCity strCity = trim(Request.Form("City")) strCity = Replace(strCity,Chr(034),"") strCity = UCase(strCity) Dim strState strState = Request.Form("State") Dim strZipCode strZipCode = trim(Request.Form("ZipCode")) Dim strCountryCode Dim strCountry Dim strArrayVal strArrayVal = split(Request.Form("Country"), ":", -1) strCountryCode = strArrayVal(0) strCountry = strArrayVal(1) If (strCountryCode <> "US" And Request("State") <> "OutsideUSA") Then Response.Redirect "error.asp?Error=

You selected " & strCountry & " as your Country. Please choose Outside USA from the State drop down box." & _ "

Please use the back button to return." Response.End ElseIf (strCountryCode = "US" And Request("State") = "OutsideUSA") Then Response.Redirect "error.asp?Error=

You selected " & strCountry & " as your Country. Please choose a State from the State drop down box." & _ "

Please use the back button to return." Response.End End If Dim strAreaCode strAreaCode = trim(Request.Form("AreaCode")) Dim strPhoneEx strPhoneEx = trim(Request.Form("PhoneEx")) Dim strPhoneNum strPhoneNum = trim(Request.Form("PhoneNum")) Dim strAreaCode2 strAreaCode2 = trim(Request("AreaCode2")) Dim strPhoneEx2 strPhoneEx2 = trim(Request.Form("PhoneEx2")) Dim strPhoneNum2 strPhoneNum2 = trim(Request.Form("PhoneNum2")) Dim strInternationalPhone strInternationalPhone = trim(Request.Form("InternationalPhone")) If Request("FName") = "" Then Response.Redirect "error.asp?Error=You must enter your first name as it appears on your credit card." &_ "

Use the Back Button below." Elseif Request("LName") = "" Then Response.Redirect "error.asp?Error=You must enter your last name as it appears on your credit card." &_ "

Use the Back Button below." Elseif Request("Email") = "" Then Response.Redirect "error.asp?Error=You must enter your email address." &_ "

Use the Back Button below." End If If inStr(strEmail, "@") Then Else Response.Redirect "error.asp?Error=The email address used does not appear to be valid.

" &_ "Please go back and check your email address.

" &_ "An example email is name@domain.com. There must be an @ sign and no www." End If If inStr(strEmail, "www") Then Response.Redirect "error.asp?Error=The email address used does not appear to be valid.

" &_ "Please go back and check your email address.

" &_ "An example email is name@domain.com. There must be an @ sign and no www." ElseIf Request("Address") = "" Then Response.Redirect "error.asp?Error=You must enter your street address." &_ "

Use the Back Button below." Elseif Request("City") = "" Then Response.Redirect "error.asp?Error=You must enter your city, town or province." &_ "

Use the Back Button below." Elseif Request("State") = "Select State" Then Response.Redirect "error.asp?Error=You must enter your state or choose International." &_ "

Use the Back Button below." Elseif Request("ZipCode") = "" Then Response.Redirect "error.asp?Error=You must enter your postal code." &_ "

Use the Back Button below." End If If Len(strPWD1) < 6 Then Response.Redirect "error.asp?Error=Your password must be 6 or more characters long." &_ "

Use the Back Button below." End If If strPWD1 = strPWD2 Then Else Response.Redirect "error.asp?Error=The Passwords that you entered do not match." &_ "

Use the back button to try again." Response.End END IF ' See if new email exists under another account. See Select Statement. DIM mySQL1, objRS1 mySQL1 = "SELECT * FROM Customers Where Email='"& strEmail &"' And CustNumber <> "& strCustNumber &"" Set objRS1 = Server.CreateObject("ADODB.Recordset") objRS1.Open mySQL1, objConn IF objRS1.EOF THEN ELSE Response.Redirect "error.asp?Error=

" & strFName & ",

" &_ strEmail & " alreay exists in an account." &_ "

Click Here if you forgot your password." &_ "

Use the back button to return to the edit account page." Response.End End If DIM mySQL, objRS mySQL = "SELECT * FROM Customers Where CustNumber="& strCustNumber &"" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open mySql, objConn, 1, 3 objRS.MoveFirst objRS("FName") = strFName objRS("MName") = strMName objRS("LName") = strLName objRS("CoName") = strCoName objRS("Email") = strEmail objRS("Active") = strActive objRS("Address") = strAddress objRS("Address2") = strAddress2 objRS("City") = strCity objRS("State") = strState objRS("ZipCode") = strZipCode objRS("Country") = strCountry objRS("CountryCode") = strCountryCode objRS("AreaCode") = strAreaCode objRS("PhoneEx") = strPhoneEx objRS("PhoneNum") = strPhoneNum objRS("AreaCode2") = strAreaCode2 objRS("PhoneEx2") = strPhoneEx2 objRS("PhoneNum2") = strPhoneNum2 objRS("InternationalPhone") = strInternationalPhone objRS("PWD") = strPWD1 objRS.Update Session("CustEmail") = Request("Email") Session("CustPWD") = Request("PWD1") Session("CustFName") = Request("FName") Response.Cookies("CustLogin")("CustEmail") = Request("Email") Response.Cookies("CustLogin")("CustPWD") = Request("PWD1") %> Customer Account Update 3 text="#<%= strText %>" link="#<%= strLink %>" vlink="#<%= strVLink %>" alink="#<%= strALink %>">

<%= strFName %>, your account information has been successfully updated.

Please verify the information below. to fix errors.

First Name: <%= strFName %>
Middle Name: <%= strMName %>
Last Name: <%= strLName %>
Company Name: <%= strCoName %> 
Email Address: <%= strEmail %>
Email Active: <%= strActive %>
Address: <%= strAddress %>
Address 2: <%= strAddress2 %> 
City/Town/Province: <%= strCity %>
State: <%= strState %>
Postal Code: <%= strZipCode %>
Country: <%= strCountry %>
Phone: <%= strAreaCode %>-<%= strPhoneEx %>-<%= strPhoneNum %> 
Phone 2: <%= strAreaCode2 %>-<%= strPhoneEx2 %>-<%= strPhoneNum2 %> 
International Phone: <%= strInternationalPhone %> 
Password: <%= strPWD1 %>