<%@LANGUAGE="VBSCRIPT"%> <% ' log out the user If LCase(Request.QueryString("logout")) = "true" then Response.Cookies("colin") ("firstname")= "" Response.Cookies("colin") ("lastname")= "" Response.Cookies("colin") ("emailaddress")= "" Response.Cookies("colin") ("remember")= "" Response.Cookies("colin") ("username")= "" Response.Cookies("colin") ("password")= "" Response.Cookies("colin").Expires = "1 January, 2000" End If %> <% IF (Request.Form("remember") = "yes") then Response.Cookies("colin") ("firstname")= Request.Form("firstname") Response.Cookies("colin") ("lastname")= Request.Form("lastname") Response.Cookies("colin") ("emailaddress")= Request.Form("emailaddress") Response.Cookies("colin") ("username")= Request.Form("username") Response.Cookies("colin") ("password")= Request.Form("password") Response.Cookies("colin"). Expires = date + 365 End If %> <% IF (Request.Form("remember1") = "yes") then Response.Cookies("colin") ("emailaddress")= Request.Form("emailaddress2") Response.Cookies("colin") ("username")= Request.Form("username2") Response.Cookies("colin") ("password")= Request.Form("password2") Response.Cookies("colin"). Expires = date + 365 End If %> <% ' *** 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 = "" %> <% ' *** Redirect if username exists MM_flag="MM_insert" If (CStr(Request(MM_flag)) <> "") Then MM_dupKeyRedirect="join.php" MM_rsKeyConnection=MM_colinlogin_STRING MM_dupKeyUsernameValue = CStr(Request.Form("emailaddress")) MM_dupKeySQL="SELECT email_address FROM colinlogin WHERE email_address='" & MM_dupKeyUsernameValue & "'" MM_adodbRecordset="ADODB.Recordset" set MM_rsKey=Server.CreateObject(MM_adodbRecordset) MM_rsKey.ActiveConnection=MM_rsKeyConnection MM_rsKey.Source=MM_dupKeySQL MM_rsKey.CursorType=0 MM_rsKey.CursorLocation=2 MM_rsKey.LockType=3 MM_rsKey.Open If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then ' the username was found - can not add the requested username MM_qsChar = "?" If (InStr(1,MM_dupKeyRedirect,"?") >= 1) Then MM_qsChar = "&" MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue Response.Redirect(MM_dupKeyRedirect) End If MM_rsKey.Close End If %> <% ' *** Insert Record: set variables If (CStr(Request("MM_insert")) <> "") Then MM_editConnection = MM_colinlogin_STRING MM_editTable = "colinlogin" MM_editRedirectUrl = "joinedup.php" MM_fieldsStr = "firstname|value|lastname|value|emailaddress|value|username|value|password|value|newsletter|value|access_level|value" MM_columnsStr = "first_name|',none,''|last_name|',none,''|email_address|',none,''|username|',none,''|password|',none,''|newsletter|none,1,0|access_level|none,none,NULL" ' 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 %> <% ' *** Insert Record: construct a sql insert statement and execute it If (CStr(Request("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" 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_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End if MM_tableValues = MM_tableValues & MM_columns(i) MM_dbValues = MM_dbValues & FormVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert 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 %> <% ' *** Validate request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString MM_valUsername=CStr(Request.Form("username2")) If MM_valUsername <> "" Then MM_fldUserAuthorization="" MM_redirectLoginSuccess="joinedup.php" MM_redirectLoginFailed="join.php?valid=false" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_colinlogin_STRING MM_rsUser.Source = "SELECT username, password" If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source & " FROM colinlogin WHERE username='" & MM_valUsername &"' AND password='" & CStr(Request.Form("password2")) & "'" MM_rsUser.CursorType = 0 MM_rsUser.CursorLocation = 2 MM_rsUser.LockType = 3 MM_rsUser.Open If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid user Session("MM_Username") = MM_valUsername If (MM_fldUserAuthorization <> "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value) Else Session("MM_UserAuthorization") = "" End If if CStr(Request.QueryString("accessdenied")) <> "" And false Then MM_redirectLoginSuccess = Request.QueryString("accessdenied") End If MM_rsUser.Close Response.Redirect(MM_redirectLoginSuccess) End If MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) End If %> ---colinisaacs.com

www.colinisaacs.com newmedia designer

 

join up

Welcome
Headline full story...

 
Apple store link  
Please join to receive details on what I am working on now and in the future.

 


if you have forgotten your password please use this link


Registered Users Please Login
   
Username
Password
   
Remember me checked <%end If%>>
 

<% IF (Request.Querystring("valid") = "false") then %> You entered either an incorrect Username or Password Please try again <% End If %>

Please enter you detail below

first name:

last name:
e-mail address:
username:
password:
newsletter:
remember me checked <%end If%>>

Somebody is using this e-mail address - please enter a different e-mail.


About Me | Site Map | Privacy Policy | Contact Us | © 2007 colin isaacs.com