<% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide - Web Wiz Guestbook '** http://www.webwizguestbook.com '** '** Copyright 2001-2006 Bruce Corkhill All Rights Reserved. '** '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** '** You should have received a copy of the License along with this program; '** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom. '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** info@webwizguide.info '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '** '**************************************************************************************** 'Set the response buffer to true as we maybe redirecting Response.Buffer = True '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 'Reset Server Variables Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing 'Redirect to unathorised user page Response.Redirect"unauthorised_user_page.htm" End If 'Dimension variables Dim intMessageID 'Holds the messageID number to be ammened Dim strAmdName 'Holds the Users name to be ammened Dim strAmdEmailAddress 'Holds the Users e-mail address to be ammened Dim strAmdHomepage 'Holds the Users homepage to be ammened Dim strAmdComments 'Holds the Users comments to be ammened Dim intAmdMessageID 'Holds the Message ID to be deleted to be ammened Dim strAmdCountry 'Holds the country to be ammended Dim blnShown 'Set to true if post is shown 'Read in user deatils from the amend comments form intAmdMessageID = CInt(Request.Form("MessageID")) strAmdName = Request.Form("name") strAmdCountry = Request.Form("country") strAmdEmailAddress = Request.Form("email") strAmdHomepage = Request.Form("homepage") strAmdComments = Request.Form("comments") blnShown = CBool(Request.Form("auth")) 'Replace harmful chracters in the amended details strAmdComments = Replace(strAmdComments, vbCrLf, "
") 'Update the database 'Initalise the SQL string with a query to read in all the comments to be amended from the database strSQL = "SELECT " & strDbTable & "Comments.* FROM " & strDbTable & "Comments WHERE " & strDbTable & "Comments.MessageID = " & intAmdMessageID & ";" 'Set the cursor type property of the record set to Dynamic so we can navigate through the record set rsCommon.CursorType = 2 'Set the Lock Type for the records so that the record set is only locked when it is updated rsCommon.LockType = 3 'Open the recordset rsCommon.Open strSQL, adoCon 'Place the amend coments into the recordset rsCommon.Fields("Name") = strAmdName rsCommon.Fields("Country") = strAmdCountry rsCommon.Fields("EMail") = strAmdEmailAddress rsCommon.Fields("Homepage") = strAmdHomepage rsCommon.Fields("Comments") = strAmdComments rsCommon.Fields("Authorised") = blnShown 'Update the database with the new recordset rsCommon.Update 'Requery the database to make sure that the new comments have been added 'This will make the script wait until Database has updated itself as sometimes Access can be a little slow at updating rsCommon.Requery 'Reset Server Variables rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing 'Return to the guestbook admin page If Request.Form("R") = "auth" Then Response.Redirect "authorise_comments_admin.asp?PN=" & Request.QueryString("PN") Else Response.Redirect "comments_admin.asp?PN=" & Request.QueryString("PN") End If %>