Log file details required !! Help
| From: | Monil Chheda | Date: | Mon, 17 Mar 2003 04:50:26 +0000 |
| Subject: | Log file details required !! Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139906@lists.php.net to get a copy of this message | ||
Hi,
I need to get some details from a LOG file as to which
keywords are used...
I have attached the LOG file.
I heed the details of the following:-
1. Ip Address
2. Date
3. The page that was requested
4. KeyWords used by the Search Engine [ Google / Yahoo
seperated ]
(ordered BY DATE) in a tabular FORMAT
I am using the following CODE.. But , it doesnt work .
Am I MISSING SOMETHING ?????
<?php
$flag = "false";
if ($fp = fopen("web.log","r")) {
while (!feof($fp)) {
$line = fgets($fp,1024);
if (ereg("\$",$line)) {
$flag="false";
}
if ($flag=="true") {
$linearray = explode(" ",$line);
$ip = $linearray[0];
$date = $linearray[1];
$keywords = $linearray[2];
echo "$ip $date $keyowrds";
}
if (ereg("\^",$line)) {
$flag = "true";
}
}
} else {
echo "Could not open file";
}
?>
Could any one please help me
Thanks...
-Monil Chheda
http://services.eliteral.com
=====
Best Regards,
Monil Chheda(INDIA)
http://domains.eliteral.com
===========================
===========================
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Attachment: [application/x-zip-compressed] web.zip web.zip
Attachment: [application/x-zip-compressed] web.zip web.zip