This is a technique that easily allows you to see who accessed you pages.

First design your page and put it on your server (you can use whatever method you wish to design it - it makes no matter. You can save it as .HTM or .HTML - that also makes no matter.

Now make a copy of your page and save it with the extension of .ASP put that on the server as well, try it out and you will see that it works exactly the same as the previous file.

Now paste the code shown below into the top of the .ASP file. Try it out and you will not see any difference on the Client Browser

<%

session.LCID = 2057
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2 ' Opens the file using the system default.
Const TristateTrue = -1 ' Opens the file as Unicode.
Const TristateFalse = 0 ' Opens the file as ASCII.

Set objFS=Server.CreateObject("Scripting.FileSystemObject")
 strFileName= Server.MapPath("vis_list.asp")


If objFS.FileExists(strFileName) = True Then
  Set objTextS = objFS.OpenTextFile(strFileName, ForAppending, False, TristateFalse)
Else
  Set objTextS = objFS.CreateTextFile(strFileName,False, False)
  MySQL = "<%"
  objTextS.WriteLine MySQL
End If



MySQL = "'"
MySQL = MySQL & SESSION( "SAFETEXT_EMAIL" ) & "', '"
MySQL = MySQL & now & "', '"
MySQL = MySQL & Request.ServerVariables("QUERY_STRING") & "', '"
MySQL = MySQL & Request.ServerVariables("HTTP_REFERER") & "', '"
MySQL = MySQL & Request.ServerVariables( "SCRIPT_NAME" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "REMOTE_ADDR" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "HTTP_USER_AGENT" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "PATH_TRANSLATED" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "HTTP_UA_COLOR" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "HTTP_UA_CPU" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "HTTP_UA_OS" ) & "', '"
MySQL = MySQL & Request.ServerVariables( "HTTP_UA_PIXELS" ) & "', '"
MySQL = MySQL & Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "', '"
MySQL = MySQL & Request.ServerVariables("HTTP_HOST") & "', '"
MySQL = MySQL & Request.ServerVariables("HTTP_PRAGMA") & "'"

objTextS.WriteLine MySQL
objTextS.Close

%>
		

You will see that it writes information to a file called vis_list.asp - it could have been called vis_list.txt but that would have allowed folk to view it in their browser. Using .asp is one step to protecting it.

If you start the vis_list.asp file with <% then the server will not allow folk to get at it. You will be able to access it by the use of FTP.

For your benefit, I have created a dummy of the file that you will create - it can be seen below. You should be able to relate it to the VBScript above. Im sorry but it is a bit wide !!

<%
'', '14/03/02 12:00:13', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (WinNT; I)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-GB,en', 'getafix', ''
'', '14/03/02 12:00:17', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (WinNT; I)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-GB,en', 'getafix', 'no-cache'
'', '14/03/02 12:00:18', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (WinNT; I)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-GB,en', 'getafix', 'no-cache'
'', '14/03/02 12:00:19', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (WinNT; I)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-GB,en', 'getafix', 'no-cache'
'', '14/03/02 11:55:28', '', '', '/testing/visited.asp', '213.122.54.36', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)', 'C:\Inetpub\Ibrus\testing\visited.asp', '', '', '', '', 'en-gb', 'www.ibrus.com', ''
'', '17/03/02 16:01:41', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-gb', 'getafix', ''
'', '17/03/02 16:14:04', '', '', '/seeif/testing/visited.asp', '10.0.69.70', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)', 'C:\InetPub\wwwroot\seeif\testing\visited.asp', '', '', '', '', 'en-gb', 'getafix', ''
		

Now there - aint that simple    !!

I do hope that it has been interesting or of benefit to you.