<% '*********************************************************** ' Modified : Rajiv Lodha ' Date : 06, June, 2006 ' Purpose : Zipcode fix ' Desc : Regular Expression changed '*********************************************************** Dim sError,strErrorText strErrorText = "" If lCase(Request("submit")) = "submit" then If Not Request.TotalBytes <= 108 Then If Request.Form("agree") = "on" Then Call MakePageHeader("Processing your request","Attention!!") Call AddNewUser() Else Call MakePageHeader("Registration Process encountered an error","Register with MyRemoteIP.com") strErrorText = "ERROR : You are required to agree with our terms & conditions" ShowRegForm End If Else Call MakePageHeader("Registration Process encountered an error","Register with MyRemoteIP.com") strErrorText = "ERROR : The form was not filled properly, some of the required information were missing." Call ShowRegForm() End If Else Call ClearSession() If Not Request.QueryString = "edit" Then Call MakePageHeader("Register with MyRemoteIP.com","Register with MyRemoteIP.com") Else Call MakePageHeader("Member Profile : " & Session("user_name"),"Member Profile : " & Session("user_name")) End If Call ShowRegForm() End If %> <% '************************************************************************************************************ 'ShowRegForm '************************************************************************************************************ ' Function ShowRegForm() If Request.QueryString = "edit" and Session("user_loggedin") Then Call conOpen sSQL = "SELECT * FROM `myip_users` where `user_id` = " & Session("user_id") Set pRS = oConn.Execute ( sSQL ) If Not ( pRS.EOF And pRS.BOF ) Then Session("email") = Trim(REDOSQL(pRS("user_email"))) Session("pass") = ReverseString(Trim(REDOSQL(pRS("user_password")))) Session("confirm") = Session("pass") Session("fname") = Split(Trim(REDOSQL(pRS("user_name").value))," ")(0) if InStr (1,pRS("user_name").value," ", vbTextCompare) > 0 Then Session("lname") = Split(Trim(REDOSQL(pRS("user_name").value)), " ")(1) Else Session("lname") = " " End If Session("add1") = Split(Trim(REDOSQL(pRS("user_address"))),"||")(0) IF InStr(1,pRS("user_address"),"||",vbTextCompare) Then Session("add2") = Split(Trim(REDOSQL(pRS("user_address"))),"||")(1) Else Session("add2") = "" End If Session("city") = Trim(REDOSQL(pRS("user_city").value)) Session("state") = Trim(REDOSQL(pRS("user_state").value)) Session("country") = Trim(REDOSQL(pRS("user_country").value)) Session("zip") = Trim(REDOSQL(pRS("user_zip").value)) Session("phone") = Trim(REDOSQL(pRS("user_phone").value)) Session("fax") = Trim(REDOSQL(pRS("user_fax").value)) Session("cell") = Trim(REDOSQL(pRS("user_mobile").value)) Session("secq") = pRS("user_secqst").value Session("seca") = pRS("user_secans").value 'hide these Session("utl") = pRS("user_trial").value Session("uvc") = pRS("user_verify_code").value Session("uvr") = pRS("user_verified").value Session("uav") = pRS("user_active").value Session("uam") = pRS("user_admin").value Session("uip") = pRS("user_ipaddress").value Session("upk") = pRS("user_package").value Session("user_datetime")= pRS("user_registered").value Session("paid_for") = pRS("paid_for").value Else Session("email") = "" Session("pass") = "" Session("confirm") = "" Session("fname") = "" Session("lname") = "" Session("add1") = "" Session("add2") = "" Session("city") = "" Session("state") = "" Session("country") = "" Session("zip") = "" Session("phone") = "" Session("fax") = "" Session("cell") = "" End If Else End If %> <% If Not Request.QueryString = "edit" Then %>
<% Else %> <% End If %> <% If Not Request.QueryString = "edit" Then %> <% Else %> <% End If %> <% If Not Request.QueryString = "edit" Then %> <% Else %> <% End IF %> <% If Not strErrorText = "" Then %> <% End If %> <% If Request.QueryString = "edit" Then %> "> "> "> "> "> "> "> "> "> <% End IF %> <% If Not Request.QueryString = "edit" Then %> <% Else %> <% End IF %> <% If Not Request.QueryString = "edit" Then %> <% Else %> <% End If %>
Please fill up this form to create an account on <%=SITE_NAME%>
Please keep your profile updated.
 
Your Email Address" maxlength="250" size="20"> <%=GetHelp(102)%>
Your Email Address" maxlength="250" size="20" READONLY style="border:0"> <%=GetHelp(102)%>
Your Password" maxlength="16" size="20"> <%=GetHelp(103)%>
Confirm Password" maxlength="16" size="20"> <%=GetHelp(104)%>
 
First Name" size="20"> <%=GetHelp(105)%>
Last Name" size="20"> <%=GetHelp(106)%>
Address (optional)" name="add1" maxlength="150" size="20"> <%=GetHelp(107)%>
 " name="add2" maxlength="150" size="20"> <%=GetHelp(108)%>
City (optional)" name="city" maxlength="50" size="20"> <%=GetHelp(109)%>
State (optional)" name="state" maxlength="50" size="20"> <%=GetHelp(110)%>
Country" maxlength="50" size="20"> <%=GetHelp(111)%>
Zipcode" maxlength="50" size="20"> <%=GetHelp(112)%>
Phone (optional)" name="phone" maxlength="50" size="20"> <%=GetHelp(113)%>
Fax (optional)" maxlength="50" size="20"> <%=GetHelp(114)%>
Cellphone/Mobile (optional)" name="mobile" maxlength="50" size="20"> <%=GetHelp(115)%>
 
Secret Question " name="secq" maxlength="250" size="20"> <%=GetHelp(117)%>
Secret Answer" name="seca" maxlength="20" size="20"> <%=GetHelp(118)%>
Confirm Secret Answer" name="confirm_seca" maxlength="20" size="20"> <%=GetHelp(119)%>
 
<%=strErrorText%>
 
 
/> I agree with all Terms & Conditions of MyRemoteIP.com<%=GetHelp(116)%>
checked="checked" /> I agree with all Terms & Conditions of MyRemoteIP.com<%=GetHelp(116)%>
 
 

 

<% End Function ' '************************************************************************************************************ '************************************************************************************************************ 'AddNewUser '************************************************************************************************************ ' Function AddNewUser Dim lAllOK, strEmailBody lAllOK = True Session("email") = Trim(ReplaceSQL(Request.Form("email"))) Session("pass") = Trim(ReplaceSQL(Request.Form("pass"))) Session("confirm") = Trim(ReplaceSQL(Request.Form("confirm"))) Session("fname") = Trim(ReplaceSQL(Request.Form("fname"))) Session("lname") = Trim(ReplaceSQL(Request.Form("lname"))) Session("add1") = Trim(ReplaceSQL(Request.Form("add1"))) Session("add2") = Trim(ReplaceSQL(Request.Form("add2"))) Session("city") = Trim(ReplaceSQL(Request.Form("city"))) Session("state") = Trim(ReplaceSQL(Request.Form("state"))) Session("country") = Trim(ReplaceSQL(Request.Form("country"))) Session("zip") = Trim(ReplaceSQL(Request.Form("zip"))) Session("phone") = Trim(ReplaceSQL(Request.Form("phone"))) Session("fax") = Trim(ReplaceSQL(Request.Form("fax"))) Session("cell") = Trim(ReplaceSQL(Request.Form("mobile"))) Session("agree") = Trim(ReplaceSQL(Request.Form("agree"))) Session("secq") = Trim(ReplaceSQL(Request.Form("secq"))) Session("seca") = Trim(ReplaceSQL(Request.Form("seca"))) If Not Request.QueryString = "edit" Then Session("user_registered") = MYSQL_NOW Session("user_trial") = MYSQL_FALSE Session("verify_code") = ToggleString(ReverseString(Session.SessionID)) Session("user_verified") = MYSQL_FALSE Session("user_active") = MYSQL_FALSE Session("user_admin") = MYSQL_FALSE Session("ip_addr") = Request.ServerVariables("REMOTE_ADDR") Session("user_package") = "-1" Session("act_link") = CONST_WEBSITE_URL & "/members/" & "activate.asp?q=" & Session("verify_code") Session("paid_for") = 0 Else Session("user_registered") = MYSQL_NOW 'Trim(ReplaceSQL(Request.Form("dtm"))) 'datetime Session("user_trial") = Trim(ReplaceSQL(Request.Form("utl"))) 'trial Session("verify_code") = Trim(ReplaceSQL(Request.Form("uvc"))) 'user verify code Session("user_verified") = Trim(ReplaceSQL(Request.Form("uvr"))) 'user verified Session("user_active") = Trim(ReplaceSQL(Request.Form("uav"))) 'user active Session("user_admin") = Trim(ReplaceSQL(Request.Form("uam"))) 'user_admin Session("ip_addr") = Trim(ReplaceSQL(Request.Form("uip"))) 'user ip Session("user_package") = Trim(ReplaceSQL(Request.Form("upk"))) 'user package Session("paid_for") = Trim(ReplaceSQL(Request.Form("pfr"))) 'user package End If If Not RegExprOK (Session("email"), REGEXP_EMAIL_CHECK) Then lAllOK = False sErrorText = "email" End If If Not RegExprOK (Session("pass"), REGEXP_SAFE_PASSWORD ) Then lAllOK = False sErrorText = "password" End If If Not Session("confirm") = Session("pass") Then lAllOK = False sErrorText = "confirm password" End If If Session("pass") <> session("confirm") then lAllOK = False sErrorText = "password mismatch" End If If Not RegExprOK (Session("fname"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "First Name" End If If Not RegExprOK (Session("lname"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "Last Name" End If If Not RegExprOK (Session("country"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "Country" End If If lAllOK Then Call conOpen IF Request.QueryString = "edit" Then ssQL = "delete from `myip_users` where `user_id` = " & session("user_id") oConn.Execute ( sSQL ) End If If Not EmailExists(Session("email")) Then sSQL = "" sSQL = "insert into myip_users(" If Request.QueryString = "edit" Then sSQL = sSQL & "user_id," End If sSQL = sSQL & "user_package,user_name,user_email,user_address,user_city,user_state," _ & "user_country,user_zip,user_phone,user_fax,user_mobile,user_password,user_registered,user_secqst,user_secans," _ & "user_ipaddress,user_verify_code,user_active,user_verified,user_admin,paid_for) " sSQL = sSQL & "values(" IF Request.QueryString = "edit" Then sSQL = sSQL & Session("user_id") & "," End If sSQL = sSQL & Session("user_package") & "," sSQL = sSQL & "'" & Session("fname") & " " & Session("lname") & "'," sSQL = sSQL & "'" & Session("email") & "'," sSQL = sSQL & "'" & Session("add1") & "||" & Session("add2") & "'," sSQL = sSQL & "'" & Session("city") & "'," sSQL = sSQL & "'" & Session("state") & "'," sSQL = sSQL & "'" & Session("country") & "'," sSQL = sSQL & "'" & Session("zip") & "'," sSQL = sSQL & "'" & Session("phone") & "'," sSQL = sSQL & "'" & Session("fax") & "'," sSQL = sSQL & "'" & Session("cell") & "'," sSQL = sSQL & "'" & ReverseString(Session("pass")) & "'," sSQL = sSQL & "'" & Session("user_registered") & "'," sSQL = sSQL & "'" & Session("secq") & "'," sSQL = sSQL & "'" & Session("seca") & "'," sSQL = sSQL & "'" & Session("ip_addr") & "'," sSQL = sSQL & "'" & Session("verify_code") & "'," sSQL = sSQL & Session("user_active") & "," sSQL = sSQL & Session("user_verified") & "," sSQL = sSQL & Session("user_admin") & "," sSQL = sSQL & Session("paid_for") sSQL = sSQL & ")" 'Response.Write sSQL oConn.Execute ( sSQL ) If Err.Number = 0 Then IF Not Request.QueryString = "edit" Then strEmailBody = ReadFromFile("/tmpl/email_activate.tmpl") strEmailBody = Replace(strEmailBody,"[TMPL_FIRST_NAME]",Session("fname")) strEmailBody = Replace(strEmailBody,"[TMPL_LAST_NAME]",Session("lname")) strEmailBody = Replace(strEmailBody,"[TMPL_EMAIL_ADDRESS]",Session("email")) strEmailBody = Replace(strEmailBody,"[TMPL_ACTIVATE_LINK]",Session("act_link")) strEmailBody = Replace(strEmailBody,"[TMPL_ACTIVATE_CODE]",Session("verify_code")) strEmailBody = Replace(strEmailBody,"[TMPL_WEBSITE_PRIVACY_LINK]",CONST_WEBSITE_URL & "/privacy.asp") strEmailBody = Replace(strEmailBody,"[TMPL_SITE_NAME]",SITE_NAME) strEmailBody = Replace(strEmailBody,"[TMPL_SITE_DESCRIPTION]",META_DESC) Call SendMail_CDOSYS (Session("email"),"Welcome to " & SITE_NAME,strEmailBody,NO_REPLY_EMAIL,"") Response.Write ("We have sent an email to your email address " & Session("email") & ". Please check your email account and follow the steps described in the email.

It may take 1 - 48 hours for the email message to reach you, but usually it takes around 1 or 2 minutes. If you have not received the verification email, please click here to resend the verification email.") Else Response.Write ("

Your profile was updated successfully.

") End If ClearSession() End If Else Response.Write ("Sorry, but you are already registered with us.") End If Call conClose Else Response.Write ("

" & sErrorText & " was left blank or was not in proper format, please correct the errors, click here to fix the same.

") End If 'Response.Redirect("/members/package.asp") End Function ' '************************************************************************************************************ '************************************************************************************************************ 'ClearSession '************************************************************************************************************ ' Public Function ClearSession Session("email") = "" Session("pass") = "" Session("confirm") = "" Session("fname") = "" Session("lname") = "" Session("add1") = "" Session("add2") = "" Session("city") = "" Session("state") = "" Session("country") = "" Session("zip") = "" Session("phone") = "" Session("fax") = "" Session("cell") = "" Session("agree") = "" Session("user_registered") = "" Session("ip_addr") = "" Session("verify_code") = "" Session("secq") = "" Session("seca") = "" End Function ' '************************************************************************************************************ %> <% Call MakePageFooter %>