<% strUserName = session("UserName") Response.Expires = 0 Response.Buffer = True ' Create a recordset object to store specific table information Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblLogin where (UserName = '" + strUserName + "')" 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 'Retrieving database info. strUserName = objRs.Fields("UserName") strPassword = objRs.Fields("Password") strLastName = objRs.Fields("LastName") strFirstName = objRs.Fields("FirstName") strAddress = objRs.Fields("Address") strCity = objRs.Fields("City") strState = objRs.Fields("State") strZip = objRs.Fields("Zip") strCountry = objRs.Fields("Country") strPhoneNumber = objRs.Fields("PhoneNumber") strFaxNumber = objRs.Fields("FaxNumber") strCellPhone = objRs.Fields("CellPhone") 'strDescription = objRs.Fields("AgentDescription") strEmailAddress = objRs.Fields("EmailAddress") strAgencyName = objRs.Fields("AgencyName") strWebsite = objRs.Fields("Website") strPic = objRs("AgentPicture") 'Retrieving form input and assigning to a variable 'txtLastName is the name of the text box on the form 'strUserName2 = Request.Form ("txtUserName") strPassword2 = Request.Form("txtPassword") strLastName2 = Request.Form ("txtLastName") strFirstName2 = Request.Form("txtFirstName") strAddress2 = Request.Form("txtAddress") strCity2 = Request.Form("txtCity") strState2 = Request.Form("State") strZip2 = Request.Form("txtZip") strCountry2 = Request.Form("Country") strPhoneNumber2 = Request.Form("txtPhoneNumber") strFaxNumber2 = Request.Form("txtFaxNumber") strCellPhone2 = Request.Form("txtCellPhone") 'strDescription2 = Request.Form("txtDescription") strWebsite2 = Request.Form("txtWebsite") strEmailAddress2 = Request.Form("txtEmailAddress") strAgencyName2 = Request.Form ("txtAgencyName") strAddPic2 = Request.Form ("radAddPic") 'This code only runs if the submit button is clicked if Request.Form <> "" then 'Sets an error message if any required fields are left blank if strPassword2 = "" or strLastName2 = "" or strFirstName2 = "" or strAgencyName2 = "" or strAddress2 = "" or strcity2 = "" or strState2 = "" or strZip2 = "" or strCountry2 = "" or strPhoneNumber2 = "" or strEmailAddress2 = "" then WarningErrMsg = "
Fields marked with an * are required." end if if not isnumeric(strPhoneNumber2) and strPhoneNumber2 <> "" then warningErrMsg = WarningErrMsg + "
Phone # can only contain numbers." end if if strPhoneNumber2 <> "" and len(strPhoneNumber2)<> "10" then warningErrMsg = WarningErrMsg + "
Phone # must contain 10 digits. Please include the area Code." end if if not isnumeric(strFaxNumber2) and strFaxNumber2 <> "" then warningErrMsg = WarningErrMsg + "
Fax # can only contain numbers." end if if strFaxNumber2 <> "" and len(strFaxNumber2)<> "10" then warningErrMsg = WarningErrMsg + "
Fax # must contain 10 digits. Please include the area Code." end if if not isnumeric(strCellPhone2) and strCellPhone2 <> "" then warningErrMsg = WarningErrMsg + "
Cell Phone can only contain numbers." end if if strCellPhone2 <> "" and len(strCellPhone2)<> "10" then warningErrMsg = WarningErrMsg + "
Cell Phone must contain 10 digits. Please include the area Code." end if 'Checks for a valid email address if strEmailAddress2 <> "" and (instr( strEmailAddress2, "@") = 0 or instr( strEmailAddress2, ".") = 0) then WarningErrMsg = WarningErrMsg + "
Email Address must be in the form account@server.com." end if 'If error message was not set, then all error checks were passed; Connect to the database if warningErrMsg = "" then ' objRs.Fields("UserName") = strUserName2 objRs.Fields("Password") = strPassword2 objRs.Fields("LastName") = strLastName2 objRs.Fields("FirstName") = strFirstName2 objRs.Fields("AgencyName") = strAgencyName2 objRs.Fields("Address") = strAddress2 objRs.Fields("City") = strCity2 objRs.Fields("State") = strState2 objRs.Fields("Zip") = strZip2 objRs.Fields("Country") = strCountry2 objRs.Fields("Website") = strWebsite2 objRs.Fields("PhoneNumber") = strPhoneNumber2 objRs.Fields("FaxNumber") = strFaxNumber2 objRs.Fields("CellPhone") = strCellPhone2 objRs.Fields("EmailAddress") = strEmailAddress2 'objRs.Fields("AgentDescription") = strDescription2 objRs.update if strAddPic2 = "1" then 'will add agent pic Response.Redirect "AgentPicUpload.asp?Id=" & objRs.Fields("LoginId") else Response.redirect "accountupdated.asp" end if end if end if %>

EDIT YOUR ACCOUNT

Edit your account information below. Once you edit your account, you will automatically be logged out and you will have to re-login.
Fields marked with an * are required.

<% if WarningErrMsg <> "" then %>
Error(s):<%= warningErrMsg %>
<% end if %>
User Name: <%= strUserName %>
Password: * <% if request.form <> "" then %> <% else %> <% end if %>
First Name: * <% if request.form <> "" then %> <% else %> <% end if %>
Last Name: * <% if request.form <> "" then %> <% else %> <% end if %>
Agency Name: * <% if request.form <> "" then %> <% else %> <% end if %>
Address: * <% if request.form <> "" then %> <% else %> <% end if %>
City: * <% if request.form <> "" then %> <% else %> <% end if %>
State/Province:* <% sSQL = "SELECT * FROM TblStates order by StateId ASC" Set rsState = Server.CreateObject("ADODB.Recordset") rsState.Open sSQL, objADO, 3, 3 %>
Zip Code: *
Country:* <% sSQL = "SELECT * FROM TblCountries order by Country_Id ASC" Set rsCountry = Server.CreateObject("ADODB.Recordset") rsCountry.Open sSQL, objADO, 3, 3 %>
Email Address: * <% if request.form <> "" then %> <% else %> <% end if %>
Website: <% if request.form <> "" then %> <% else %> <% end if %> (full url)
Phone #: * <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
Fax #: <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
Cell #: <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)

<% if objRs("AgentPicture") <> "" then %> You already have a picture uploaded. Do you want to edit it? <% else %> Do you want to upload your picture? <% end if %>
Yes No