% Option Explicit %> <% 'Set the response buffer to true Response.Buffer = True 'Dimension variables Dim rsNewsConfig 'Recorset holding all the username in the database Dim strMode 'holds the mode of the page, set to true if changes are to be made to the database 'If the session variable is False or does not exsist then redirect the user to the unauthorised user page If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then 'Redirect to unathorised user page Response.Redirect"unauthorised_user_page.htm" End If 'Read in the users colours for the mailing list strBgColour = Request.Form("bg") strTextColour = Request.Form("text") strTextType = Request.Form("FontType") intTextSize = CInt(Request.Form("FontSize")) strLinkColour = Request.Form("links") strVisitedLinkColour = Request.Form("vLinks") strHoverLinkColour = Request.Form("aLinks") strMode = Request.Form("mode") 'Intialise the ADO recordset object Set rsNewsConfig = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT tblConfiguration.* From tblConfiguration;" 'Set the cursor type property of the record set to Dynamic so we can navigate through the record set rsNewsConfig.CursorType = 2 'Set the Lock Type for the records so that the record set is only locked when it is updated rsNewsConfig.LockType = 3 'Query the database rsNewsConfig.Open strSQL, strCon 'If the user is changing the colours then update the database If strMode = "change" Then 'Update the recordset rsNewsConfig.Fields("bg_colour") = strBgColour rsNewsConfig.Fields("text_colour") = strTextColour rsNewsConfig.Fields("text_type") = strTextType rsNewsConfig.Fields("text_size") = intTextSize rsNewsConfig.Fields("links_colour") = strLinkColour rsNewsConfig.Fields("visited_links_colour") = strVisitedLinkColour rsNewsConfig.Fields("active_links_colour") = strHoverLinkColour 'Update the database with the new user's colours rsNewsConfig.Update 'Re-run the query to read in the updated recordset from the database rsNewsConfig.Requery End If 'Read in the mailing list colours from the database If NOT rsNewsConfig.EOF Then 'Read in the colour info from the database strBgColour = rsNewsConfig.Fields("bg_colour") strTextColour = rsNewsConfig.Fields("text_colour") strTextType = rsNewsConfig.Fields("text_type") intTextSize = CInt(rsNewsConfig.Fields("text_size")) strLinkColour = rsNewsConfig.Fields("links_colour") strVisitedLinkColour = rsNewsConfig.Fields("visited_links_colour") strHoverLinkColour = rsNewsConfig.Fields("active_links_colour") End If 'Reset Server Objects rsNewsConfig.Close Set rsNewsConfig = Nothing Set adoCon = Nothing Set strCon = Nothing %>