Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "header.php"; ?>
- <table border=0>
- <?
- $rowdata = "<tr><td>%typeimg%</td><td>%time%</td><td>%user%</td><td>%url%</td><td>%time</td><td>%amount%</td></tr>";
- $file_name = "/var/www/db/access.log";
- $data = file_get_contents($file_name);
- $data = explode("\n",$data);
- echo "There are ".count($data)." lines.<br><br>";
- while($i<=count($data))
- {
- $splat = explode("|",$data[$i]);
- /*
- //Type = Seg 8
- if($splat['9']=="text/html"){
- $type = "<img src='images/16x16/mimetypes/text-html.png'></img>";
- }elseif($splat['9']=="image/png"){
- $type = "<img src='images/16x16/mimetypes/image-x-generic.png'></img>";
- echo "HAI";
- }else{
- $type = "<img src='images/16x16/mimetypes/text-x-generic.png'></img>";
- }
- */
- switch ($splat['9']) {
- case "text/html":
- echo "<img src='images/16x16/mimetypes/text-html.png'></img>";
- break;
- case 1:
- echo "i equals 1";
- break;
- case 2:
- echo "i equals 2";
- break;
- }
- //The Replacinator...
- $rowdata = str_replace("%typeimg%", $type, $rowdata);
- echo $rowdata;
- echo "\n";
- $i++;
- }
- ?>
- </table>
- <?php include "footer.php"; ?>
Add Comment
Please, Sign In to add comment