Guest User

Untitled

a guest
Apr 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php include "header.php"; ?>
  2.  
  3. <table border=0>
  4. <?
  5. $rowdata = "<tr><td>%typeimg%</td><td>%time%</td><td>%user%</td><td>%url%</td><td>%time</td><td>%amount%</td></tr>";
  6.  
  7. $file_name = "/var/www/db/access.log";
  8. $data = file_get_contents($file_name);
  9. $data = explode("\n",$data);
  10. echo "There are ".count($data)." lines.<br><br>";
  11.  
  12. while($i<=count($data))
  13. {
  14. $splat = explode("|",$data[$i]);
  15.  
  16. /*
  17. //Type = Seg 8
  18. if($splat['9']=="text/html"){
  19. $type = "<img src='images/16x16/mimetypes/text-html.png'></img>";
  20. }elseif($splat['9']=="image/png"){
  21. $type = "<img src='images/16x16/mimetypes/image-x-generic.png'></img>";
  22. echo "HAI";
  23. }else{
  24. $type = "<img src='images/16x16/mimetypes/text-x-generic.png'></img>";
  25. }
  26. */
  27.  
  28. switch ($splat['9']) {
  29. case "text/html":
  30. echo "<img src='images/16x16/mimetypes/text-html.png'></img>";
  31. break;
  32. case 1:
  33. echo "i equals 1";
  34. break;
  35. case 2:
  36. echo "i equals 2";
  37. break;
  38. }
  39.  
  40. //The Replacinator...
  41. $rowdata = str_replace("%typeimg%", $type, $rowdata);
  42.  
  43. echo $rowdata;
  44. echo "\n";
  45. $i++;
  46. }
  47. ?>
  48. </table>
  49. <?php include "footer.php"; ?>
Add Comment
Please, Sign In to add comment