<%@LANGUAGE="VBSCRIPT"%> <% '=============================================== ' Personals System 2002 ' ©2002 vSpin.net. www.vspin.net '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. vSpin.net copyright notices must ' remain in the ASP sections of the code. '=============================================== %> <% ' *** Restrict Access To Page: Grant or deny access to this page Dim MM_authorizedUsers, MM_authFailedURL, MM_grantAccess MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% dim xxxxm, rsheadUpdatee, rsheadUpdatee_numRows Dim field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, MM_editAction, MM_abortEdit, MM_editQuery, MM_editConnection, MM_editTable, MM_editColumn, MM_recordId, MM_editRedirectUrl, MM_fieldsStr, MM_columnsStr, MM_fields, MM_columns, i, FormVal, MM_typeArray, Delim, AltVal, EmptyVal, MM_editCmd if (Session("MM_Username") <> "") then rsSession__MMColParam = Session("MM_Username") Dim rs_main_numRows set rs_main = Server.CreateObject("ADODB.Recordset") rs_main.ActiveConnection = MM_conn_STRING rs_main.Source = "SELECT * FROM p_users WHERE p_user = '" + Replace(rsSession__MMColParam, "'", "''") + "'" rs_main.CursorType = 0 rs_main.CursorLocation = 2 rs_main.LockType = 3 rs_main.Open() rs_main_numRows = 0 if request.form("MM_update") = "true" then if NOT request.form("textfield2") = request.form("textfield12") Then field1 = rs_main("p_user") field3 = request.form("textfield3") field4 = request.form("textfield4") field5 = request.form("textfield5") field6 = request.form("textfield6") field7 = request.form("textfield7") field8 = request.form("textfield8") field9 = request.form("textfield9") field10 = request.form("textfield10") field11 = request.form("textfield11") message = 53 %>

 Edit Account - This is private information won't be shown in your profile. This information is for our records only.

  

Password:
re-type Password:
First Name:
Last Name:
E-mail Address:
Phone:
Fax:
Address:
City/Town:
State:
Zip/Postal Code:

checked<% end if %>> Yes, Send me News & Updates
checked<% end if %>> Remember my User ID & Password for login. Warning: Read First!

<% else ' *** 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 = "" %> <% ' *** Update Record: set variables If (CStr(Request("MM_update")) <> "" And Session("MM_Username") <> "") Then MM_editConnection = MM_conn_STRING MM_editTable = "p_users" MM_editColumn = "p_user" MM_recordId = "'" + Session("MM_Username") + "'" MM_editRedirectUrl = "default.asp?message=9" MM_fieldsStr = "textfield2|value|textfield4|value|textfield5|value|textfield6|value|textfield7|value|textfield8|value|textfield9|value|textfield10|value|textfield3|value|textfield11|value|checkbox|value" MM_columnsStr = "p_password|',none,''|p_first|',none,''|p_last|',none,''|p_email|',none,''|p_phone|',none,''|p_fax|',none,''|p_address|',none,''|p_city|',none,''|p_state|',none,''|p_zip|',none,''|p_newsletter|',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 %> <% ' *** Update Record: construct a sql update statement and execute it If (CStr(Request("MM_update")) <> "" And Session("MM_Username") <> "") Then ' create the sql update statement MM_editQuery = "update " & MM_editTable & " set " 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_editQuery = MM_editQuery & "," End If MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal Next MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then Response.Buffer = True If request("SAVECOOKIES") = "yes" then Response.Cookies("access") = textfield2 Response.Cookies("access").Expires = Date() + 365 Response.Cookies("id") = session("MM_Username") Response.Cookies("id").Expires = Date() + 365 else Response.Cookies("id") = "$" Response.Cookies("id").Expires = Date() + 1 Response.Cookies("access") = "$" Response.Cookies("access").Expires = Date() + 1 end if ' execute the update 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 end if else field1 = rs_main("p_user") field2 = rs_main("p_password") field3 = rs_main("p_first") field4 = rs_main("p_last") field5 = rs_main("p_email") field6 = rs_main("p_address") field7 = rs_main("p_phone") field8 = rs_main("p_fax") field9 = rs_main("p_city") field10 = rs_main("p_state") field11 = rs_main("p_zip") field13 = rs_main("p_newsletter") %>

 Edit Account - This is private information won't be shown in your profile. This information is for our records only.

  

Password:
re-type Password:
First Name:
Last Name:
E-mail Address:
Phone:
Fax:
Address:
City/Town:
State:
Zip/Postal Code:

checked<% end if %>> Yes, Send me News & Updates
checked<% end if %>> Remember my User ID & Password for login. Warning: Read First!

<% end if rs_main.Close MM_conn_STRING.Close set MM_conn_STRING = nothing set rs_main = nothing %>