Jump to content

Small script to record user browsers to text file.


hungryOrb

Recommended Posts

Hi :D

I wonder if someone could spend 20 seconds helping me with this? please please!

My code so far:

 

<?php 

$browserFile = "browsers.txt";
$fh = fopen($browserFile, 'a') or die("can't open browser txt file");


if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')){
echo $this->template; ?>/css/template.css" rel="stylesheet" type="text/css" /><?php 
$stringData = "Date: ".date("D/M/Y").". Firefox\n";
fwrite($fh, $stringData);
fclose($fh);

}else{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')){
echo $this->template; ?>/css/template.css" rel="stylesheet" type="text/css" /><?php 
$stringData = "Date: ".date("D/M/Y").". InternetExplorer 6\n";
fwrite($fh, $stringData);
fclose($fh);

}else{
echo $this->template; ?>/css/template.css" rel="stylesheet" type="text/css" /><?php 
$stringData = "Date: ".date("D/M/Y").". Other browser\n";
fwrite($fh, $stringData);
fclose($fh);

}
}
?>

 

EEP.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.