[liphp] Sample Code

Aram Mirzadeh [email protected]
Wed, 15 Oct 2003 03:18:54 -0400


Out of total curiocity, why aren't you using the reference log that the
web server generates?  The output is even more configurable if you are
running Apache or something like it. 

Aram

On Tue, 2003-10-14 at 17:40, Orrin Edwards wrote:
> Hello All,
> 
> I use this php code on one of my web pages to record the date and
> user Agent of the visitor:
> 
>  <?php
>       $agent = "agent.log";
>       $fd1 = fopen($agent, "a");
>       $today = getdate();
>       $year = $today['year'];
>       $month = $today['mon'];
>       $day = $today['mday'];
>       $hour = $today['hours'];
>       $min = $today['minutes'];
>       $adata = $_SERVER["HTTP_USER_AGENT"];
>       fwrite($fd1, "$year-$month-$day $hour:$min  ");
>       fwrite($fd1, "{$adata}\n");
>       fclose($fd1);
>     ?>
> 
> ... and the result in the agent.log file is:
> 
> 2003-10-13 23:42  Mozilla/4.0 (compatible; MSIE 5.5; Windows 98;
> (R1 1.3))
> 2003-10-13 23:58  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
> 5.1)
> 2003-10-14 0:54  Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win
> 9x 4.90)
> 2003-10-14 1:28  Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
> 
> ...which presents the question.. What is NT 5.0 and NT 5.1? Is this
> how XP is reported from the user agent?
> 
> Also any ideas as to how to include screen resolution in this code
> would be appreciated. There apparently is no php code to report
> screen resolution.
> 
> 
> =====
> Orrin - Long Island, New York
> http://www.orrin.org/            Site Index
> http://www.orrin.org/carib/    Caribbean Index
> http://www.orrin.org/syocc/   Syosset Camera Club
> http://www.orrin.org/aruba/   Aruba Trip Notes  
> 
> Linux by SuSE... a world without Windows!
> _______________________________________________
> Liphp mailing list
> [email protected]
> https://www.liphp.org/mailman/listinfo/liphp
-- 
Aram Mirzadeh <[email protected]>