An example of the output of the viewlog page showign a table with four columns of logged dataYou have viewed the log file directly or using FTP but for Pandora that would be unnecessarily complicated (plus you would rarely want to give a client FTP access).

Create a new page called viewlog.php based on index.php and in it:

  1. just under the main h1 heading put the start of a table:
    1. the opening table tag
    2. a tr element
    3. inside that tr element put four th elements with the following text inside:
      1. User IP
      2. Browser
      3. Page visited
      4. Time
  2. under that create a PHP block with <?php and ?>
  3. inside the PHP block extract the contents of the log file and put them in a variable
  4. create a foreach loop which gets each line of the file and puts it into a variable called $fileEntry
  5. inside the loop:
    1. explode each line into an array called $fileEntryArray based on the \t
    2. extract the four items from the array into four variables
    3. echo a tr which contains four td elements containing the four variables
  6. under (outside of) the PHP block put the closing table tag