Get Some Information from clients

Results 1 to 2 of 2

Thread: Get Some Information from clients

  1. #1
    Rofik Guest

    Default Get Some Information from clients

    I want make a statistic from my site, like who enter my site, from IP, with my database I know from where my clients (country,....etc)<BR>How I use Server Side Include Variables ? like "REMOTE_ADDR" ?<BR>thank you

  2. #2
    Ricardo Londe Guest

    Default RE: Get Some Information from clients

    I know of possible ways for doing it.<BR>The first one is to use your IIS log file. It isn&#039t difficult but you must have physical access to the log.<BR><BR>The other way is a purely ASP way. Here are the steps:<BR>1. Make sure your site is setup as an application on IIS.<BR><BR>2. Create a database (use Access or SQL Server) and and ODBC dsn for it( let&#039s call it STAT)<BR><BR>3. Create a table ( let&#039s call it SiteStat) with the following fields (you can add more if you please):<BR>IP VarChar( 15)<BR>dtAccess VarChar( 20)<BR><BR>4. Edit your global.asa and put the following code in the Session_OnStart event:<BR><BR>Sub Session_OnStart()<BR>Dim rstStat Dim sIp <BR>Dim sDateTime <BR>Dim sSQL<BR><BR>sIp = Request.ServerVariables("REMOTE_ADDR")<BR>sDateTim e = Now()<BR>Set rstStat = server.CreateObject( "ADODB.RECORDSET")<BR>sSQL = "INSERT siteStat VALUES (&#039" & sIP & "&#039, &#039" _ <BR>& sDateTime & "&#039")<BR><BR>rstStat.Open sSQL, "dsn=STAT;" <BR><BR>rstStat.Close<BR>Set rstStat = nothing<BR><BR>End Sub<BR><BR>That&#039s all folks! I hope this helps.<BR>

Posting Permissions

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