アクセスログ

errlogはこちら 詳しいaccesslogはこちら
".$row['title']."
"; // echo $row['comment']."
"; // } //echo $LOG; //if($LOG=""){ //for($i=0;$i<30;$i++){echo "
";} //} $ac_arr = array($LOG); $astring = join("", $ac_arr); $astring = preg_replace("/(\n|\r|\t)/", "", $astring); $records = preg_split("/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $astring, -1, PREG_SPLIT_DELIM_CAPTURE); $sizerecs = sizeof($records); // now split into records $i = 1; $each_rec = 0; while($i<$sizerecs) { $ip = $records[$i]; $all = $records[$i+1]; // parse other fields preg_match("/\[(.+)\]/", $all, $match); $access_time = $match[1]; $all = str_replace($match[1], "", $all); preg_match("/\"GET (.[^\"]+)/", $all, $match); $http = $match[1]; $link = explode(" ", $http); $all = str_replace("\"GET $match[1]\"", "", $all); preg_match("/([0-9]{3})/", $all, $match); $success_code = $match[1]; $all = str_replace($match[1], "", $all); preg_match("/\"(.[^\"]+)/", $all, $match); $ref = $match[1]; $all = str_replace("\"$match[1]\"", "", $all); preg_match("/\"(.[^\"]+)/", $all, $match); $browser = $match[1]; $all = str_replace("\"$match[1]\"", "", $all); preg_match("/([0-9]+\b)/", $all, $match); $bytes = $match[1]; $all = str_replace($match[1], "", $all); print("
IP: $ip
Access Time: $access_time
Page: "); print "".$link[0].""; print("
Type: $link[1]
Success Code: $success_code
Bytes Transferred: $bytes
Referer: $ref
Browser: $browser
"); // advance to next record $i = $i + 2; $each_rec++; } ?>