hello hopefully some one can help me , heres my problem :

i have a log.txt file with hundreds of entrys in this format:

[2004.12.08 06:41:22] 559ac31823202393c181f6672796bce6 "DANNY" "65.22.33.22" home

i am trying to build a search form so when i search for a portion of this log file for example say the name "DANNY" it searches the log finds the data and ECHO'S just that one complete text line .

i would like it to ECHO the textline in an array .
so i can have each array in a different colum in a table .

So end reslut would be :

I type in Danny in a search form and hit the submit button
it searches the log finds the line and prints in a table in array form like this:

<table width="200" border="1">
<tr>
<td>2004.12.08 06:41:22</td>
<td>559ac31823202393c181f6672796bce6</td>
<td>DANNY</td>
<td>65.22.33.22</td>
<td>home</td>
</tr>
</table>

i can open the log read the file and i can build the array but i cant get the information to properly populate my table .
im sure you can tell im new ,but i have been working on this one part for about a week so you can not say the efforts not there ,lol.

Well i hope one you can help me .
Thank you in advance
Kurt fury .

    You don't say how you've built the array, so it might not work but have you tried:

    <table width="200" border="1">
    <tr>
    <td><?PHP echo $myarray[0]; ?></td>
    <td><?PHP echo $myarray[1]; ?></td>
    <td><?PHP echo $myarray[2]; ?></td>
    <td><?PHP echo $myarray[3]; ?></td>
    <td><?PHP echo $myarray[4]; ?></td>
    </tr>
    </table>
    

    You could also use the array component names if you have them instead of 0-4

    HTH - Blu

      this how the array in my table is set :
      <table width="200" border="1">
      <tr>
      <td><?PHP echo $p[0]; ?></td>
      <td><?PHP echo $p[1]; ?></td>
      <td><?PHP echo $p[2]; ?></td>
      <td><?PHP echo $p[3]; ?></td>
      <td><?PHP echo $p[4]; ?></td>
      </tr>
      </table>

      my problem is i guess im not writing the funtion properly .

      $lfDispl->setAlign("bottom"); // Last row on bottom
      $lfDispl->setFilepath($filename); // from this logfile
      $countRows = $lfDispl->rowSize(); // Count the rows (allways the complete file)
      $rowArray = $lfDispl->readRows(); // All Rows in array

      $lines = file('access.log');
      
      foreach ($lines as $line) {
      
          $p = explode(' ', $line);
      
          echo $p[0]; // prints 
          echo $p[1]; // prints 
          echo $p[2]; // prints   
          echo $p[3]; // prints 
          echo $p[4]; // prints 
          echo $p[5]; // prints 
      }

      // Debug output:
      echo "File got ".$countRows." Rows <br />";
      echo "<pre>";
      print_r($rowArray);
      echo "</pre>";

        Write a Reply...