<% '**************************************************************************************** '** 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 '** '**************************************************************************************** '****************************************** '*** Strip non alphanumeric characters **** '****************************************** 'Function to strip non alphanumeric characters for links and email addresses Private Function characterStrip(strTextInput) 'Dimension variable Dim intLoopCounter 'Holds the loop counter 'Loop through the ASCII characters For intLoopCounter = 0 to 37 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the ASCII characters For intLoopCounter = 39 to 44 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the ASCII characters numeric characters to lower-case characters For intLoopCounter = 65 to 94 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the extended ASCII characters For intLoopCounter = 123 to 125 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the extended ASCII characters For intLoopCounter = 127 to 255 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Strip individul ASCII characters left out from above left over strTextInput = Replace(strTextInput, CHR(59), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(60), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(62), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(96), "", 1, -1, 0) 'Return the string characterStrip = strTextInput End Function '****************************************** '*** Decode encoded HTML strings **** '****************************************** 'Decode encoded strings Private Function decodeString(ByVal strInputEntry) 'Remove malisous charcters from links and images strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 0) strInputEntry = Replace(strInputEntry, "a", "a", 1, -1, 0) strInputEntry = Replace(strInputEntry, "b", "b", 1, -1, 0) strInputEntry = Replace(strInputEntry, "c", "c", 1, -1, 0) strInputEntry = Replace(strInputEntry, "d", "d", 1, -1, 0) strInputEntry = Replace(strInputEntry, "e", "e", 1, -1, 0) strInputEntry = Replace(strInputEntry, "f", "f", 1, -1, 0) strInputEntry = Replace(strInputEntry, "g", "g", 1, -1, 0) strInputEntry = Replace(strInputEntry, "h", "h", 1, -1, 0) strInputEntry = Replace(strInputEntry, "i", "i", 1, -1, 0) strInputEntry = Replace(strInputEntry, "j", "j", 1, -1, 0) strInputEntry = Replace(strInputEntry, "k", "k", 1, -1, 0) strInputEntry = Replace(strInputEntry, "l", "l", 1, -1, 0) strInputEntry = Replace(strInputEntry, "m", "m", 1, -1, 0) strInputEntry = Replace(strInputEntry, "n", "n", 1, -1, 0) strInputEntry = Replace(strInputEntry, "o", "o", 1, -1, 0) strInputEntry = Replace(strInputEntry, "p", "p", 1, -1, 0) strInputEntry = Replace(strInputEntry, "q", "q", 1, -1, 0) strInputEntry = Replace(strInputEntry, "r", "r", 1, -1, 0) strInputEntry = Replace(strInputEntry, "s", "s", 1, -1, 0) strInputEntry = Replace(strInputEntry, "t", "t", 1, -1, 0) strInputEntry = Replace(strInputEntry, "u", "u", 1, -1, 0) strInputEntry = Replace(strInputEntry, "v", "v", 1, -1, 0) strInputEntry = Replace(strInputEntry, "w", "w", 1, -1, 0) strInputEntry = Replace(strInputEntry, "x", "x", 1, -1, 0) strInputEntry = Replace(strInputEntry, "y", "y", 1, -1, 0) strInputEntry = Replace(strInputEntry, "z", "z", 1, -1, 0) strInputEntry = Replace(strInputEntry, "A", "A", 1, -1, 0) strInputEntry = Replace(strInputEntry, "B", "B", 1, -1, 0) strInputEntry = Replace(strInputEntry, "C", "C", 1, -1, 0) strInputEntry = Replace(strInputEntry, "D", "D", 1, -1, 0) strInputEntry = Replace(strInputEntry, "E", "E", 1, -1, 0) strInputEntry = Replace(strInputEntry, "F", "F", 1, -1, 0) strInputEntry = Replace(strInputEntry, "G", "G", 1, -1, 0) strInputEntry = Replace(strInputEntry, "H", "H", 1, -1, 0) strInputEntry = Replace(strInputEntry, "I", "I", 1, -1, 0) strInputEntry = Replace(strInputEntry, "J", "J", 1, -1, 0) strInputEntry = Replace(strInputEntry, "K", "K", 1, -1, 0) strInputEntry = Replace(strInputEntry, "L", "L", 1, -1, 0) strInputEntry = Replace(strInputEntry, "M", "M", 1, -1, 0) strInputEntry = Replace(strInputEntry, "N", "N", 1, -1, 0) strInputEntry = Replace(strInputEntry, "O", "O", 1, -1, 0) strInputEntry = Replace(strInputEntry, "P", "P", 1, -1, 0) strInputEntry = Replace(strInputEntry, "Q", "Q", 1, -1, 0) strInputEntry = Replace(strInputEntry, "R", "R", 1, -1, 0) strInputEntry = Replace(strInputEntry, "S", "S", 1, -1, 0) strInputEntry = Replace(strInputEntry, "T", "T", 1, -1, 0) strInputEntry = Replace(strInputEntry, "U", "U", 1, -1, 0) strInputEntry = Replace(strInputEntry, "V", "V", 1, -1, 0) strInputEntry = Replace(strInputEntry, "W", "W", 1, -1, 0) strInputEntry = Replace(strInputEntry, "X", "X", 1, -1, 0) strInputEntry = Replace(strInputEntry, "Y", "Y", 1, -1, 0) strInputEntry = Replace(strInputEntry, "Z", "Z", 1, -1, 0) strInputEntry = Replace(strInputEntry, "0", "0", 1, -1, 0) strInputEntry = Replace(strInputEntry, "1", "1", 1, -1, 0) strInputEntry = Replace(strInputEntry, "2", "2", 1, -1, 0) strInputEntry = Replace(strInputEntry, "3", "3", 1, -1, 0) strInputEntry = Replace(strInputEntry, "4", "4", 1, -1, 0) strInputEntry = Replace(strInputEntry, "5", "5", 1, -1, 0) strInputEntry = Replace(strInputEntry, "6", "6", 1, -1, 0) strInputEntry = Replace(strInputEntry, "7", "7", 1, -1, 0) strInputEntry = Replace(strInputEntry, "8", "8", 1, -1, 0) strInputEntry = Replace(strInputEntry, "9", "9", 1, -1, 0) 'Return decodeString = strInputEntry End Function '****************************************** '*** Random Hex Generator **** '****************************************** Private Function hexValue(ByVal intHexLength) Dim intLoopCounter Dim strHexValue 'Randomise the system timer Randomize Timer() 'Generate a hex value For intLoopCounter = 1 to intHexLength 'Genreate a radom decimal value form 0 to 15 intHexLength = CInt(Rnd * 1000) Mod 16 'Turn the number into a hex value Select Case intHexLength Case 1 strHexValue = "1" Case 2 strHexValue = "2" Case 3 strHexValue = "3" Case 4 strHexValue = "4" Case 5 strHexValue = "5" Case 6 strHexValue = "6" Case 7 strHexValue = "7" Case 8 strHexValue = "8" Case 9 strHexValue = "9" Case 10 strHexValue = "A" Case 11 strHexValue = "B" Case 12 strHexValue = "C" Case 13 strHexValue = "D" Case 14 strHexValue = "E" Case 15 strHexValue = "F" Case Else strHexValue = "Z" End Select 'Place the hex value into the return string hexValue = hexValue & strHexValue Next End Function '****************************************** '*** Format International Date/Time **** '****************************************** 'Function to format the present date and time into international formats to prevent systems crashes on foriegn servers Private Function internationalDateTime(dtmDate) 'This function returns the internation date and time formats:- yyyy-mm-dd hh:mm:ss 'Dashes prevent systems that use periods etc. from crashing internationalDateTime = Year(dtmDate) & "-" & Month(dtmDate) & "-" & Day(dtmDate) & " " & Hour(dtmDate) & ":" & Minute(dtmDate)& ":" & Second(dtmDate) End Function %>