www.webdeveloper.com
Results 1 to 2 of 2

Thread: user data capture

  1. #1
    Join Date
    Dec 2004
    Posts
    429

    user data capture

    i only need IP address and Referrer. Email would be great but I do not believe this is possible. Also how do i write this to a text file and how to I storge that Text file. do I place it on the server and ftp the server to view the text file?


    Index.asp
    GetUserData() 'this could be at the top of the page


    Common.asp
    Public Sub GetUserData()
    'get the values that you want
    Dim RemoteAddress
    RemoteAddress = Request.ServerVariables("REMOTE_ADDR")

    'we got the value not write it to a text file

    End SUb


    Webmaster
    http://www.ptsdcs.com
    Last edited by jmaresca2005; 05-19-2005 at 03:19 PM.

  2. #2
    Join Date
    Dec 2004
    Posts
    8,637
    Code:
    <%
       Const ForReading = 1, ForWriting = 2, ForAppending = 8
       Dim objFSO, objFileName, objOpenFile, RemoteAddress, ReferringSite
       Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
       Set objFileName = objFSO.GetFile(Server.MapPath("/log.txt"))
       Set objOpenFile = objFileName.OpenAsTextStream(ForAppending)
    '
       RemoteAddress = Request.ServerVariables("REMOTE_ADDR")
       ReferringSite = Request.ServerVariables("HTTP_REFERER")
       objOpenFile.WriteLine "IP:: " & RemoteAddress & "; ReferredBy:: " & ReferringSite & ";"
    '
       objOpenFile.Close
       Set objOpenFile = Nothing
       Set objFileName = Nothing
       Set objFSO = Nothing
    %>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles