View Single Post
  #8 (permalink)  
Old Oct 30th, 2007, 13:04
eon201 eon201 is offline
Up'n'Coming Member
Join Date: Oct 2007
Location: london
Age: 25
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using standard web logs

OK so im using this code so far in my php...
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="60" />
<title>Untitled Document</title>
</head>
<body>
<p>This should print the text file</p>
<?php
$filename = 'file.txt';
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));

print($contents);
fclose($fp);
?>
</body>
</html>
and my raw server log looks like this (any ip's have been * out)
Code: Select all
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2007-10-10 12:28:14
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) sc-status sc-win32-status sc-bytes cs-bytes time-taken 
2007-10-10 12:28:14 W3SVC10019 **.***.***.*** GET /site/familycruising/familyaccommodation/familysuites - ** - **.*.**.*** HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) - - *** * **** *** ***
There are obviously more lines than that but the first 4 are generics put in by the server, whilst any lines after the 4th one are the ones I wish to format.

Thanks, eon201

ps. You would have thought I could have had something easier to do in my first php challenge! lol
Reply With Quote