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
<?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
web.zip
Description: web.zip
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

