<% dim rsLogin, objDb,strSQL,strErr,bShowForm, objMail bShowForm = 1 if Request("formSubmitted") = 1 then set objDb = dbInit("cupcake") ' check if email address exists dim dictUser set dictUser = Server.CreateObject("Scripting.Dictionary") for each key in Request.Form dictUser.Add key, replace(Request(key),"'","''") next strSQL = "spUserView 4,'" & dictUser("email_address") & "'" rsUser = objDb.Execute(strSQL) if rsUser("count") < 1 then bShowForm = 0 ' the last number in the SQL string is the default admin privilege level(0) and the default account status(3= requires approval) strSQL = "spUserAdd '" & dictUser("first_name") & "','" & dictUser("last_name") & "','" & dictUser("agency_name") & "','" & dictUser("phone_number") & "','" & dictUser("mail_address") & "','" & dictUser("city") & "','" & dictUser("state") & "','" & dictUser("zip_code") & "','" & dictUser("password") & "','" & dictUser("email_address") & "','3','0'" objDb.Execute(strSQL) ' send email to admin set objMail = Server.CreateObject("CDONTS.NewMail") strBody = "We have received a new login request from " & dictUser("first_name") & " " & dictUser("last_name") & "(" & dictUser("email_address") & ")." &vbcrlf &vbcrlf &_ "Please login to the administrative tools, select User Administration from the menu, select approve from the action menu and any users waiting for approval will be displayed. " objMail.To = EMAIL_APPROVAL_ADMIN objMail.From = EMAIL_APPROVAL_SENDER objMail.Subject = "Bakco.com Website - New Log In Request" objMail.Body = strBody objMail.Send set objMail = nothing 'send email to person who requested login set objMail = Server.CreateObject("CDONTS.NewMail") strBody = "Thank you for submitting your request for access to Baker Associates Agent Resources." &vbcrlf &vbcrlf &_ "Once your account has been reviewed and approved, you will receive an email letting you know that you can now login." &vbcrlf &vbcrlf &_ "Should you have any questions or need additional help, please feel free to call our office at 1-888-899-6599. " &vbcrlf &vbcrlf &_ "Baker Associates " objMail.To = dictUser("email_address") objMail.From = EMAIL_APPROVAL_ADMIN objMail.Subject = "Confirmation of your login request" objMail.Body = strBody objMail.Send set objMail = nothing ' show success page strErr = "" server.execute "success.asp" else strError = "Error: " & Request("email_address") & " is already in use. Please choose a different email or use the forgotten password utility." end if end if if (bShowForm = 1) then %>

To sign up for a new account, please complete the information below. Once submitted, your account will be reviewed and when approved, you will receive an email letting you know that your account is now accessible. Please note, items with a red asterisk * are required.
<% Response.write strError %>

" onSubmit="MM_validateForm('First_Name','','R','Last_Name','','R','Agency_Name','','R','Phone_Number','','R','Email_Address','','RisEmail_Address','password','','R');return document.MM_returnValue">
* Required Fields
* First Name ">
* Last Name ">
* Agency Name ">
* Phone Number ">
Mailing Address ">
City ">
State
Zip Code ">
* Email Address ">
* Desired Password ">
 
<% 'Response.Write TheMessage %>
<% end if %>