nexxnoodlz
07-25-2005, 06:04 PM
Ages ago my mates and I setup a three word thread project to our website. Over time we added different variations to it on different pages, but decided to have the first one as the main one.
So the main page shows the data.txt but we wanna change it so that the main page shows the last few lines of all our other thread can this be done easily?
Below is the bit in our php file that opens the whole data.txt file (if its any help)
<?php
$file_loc = "data.txt";
$file = fopen($file_loc, "r");
if(!$file)
{
echo "<p>Error: Unable to open $file_loc.</p>";
}
else
{
while(!feof ($file))
{
$line = fgets($file, 1024);
echo $line;
}
}
?>
So the main page shows the data.txt but we wanna change it so that the main page shows the last few lines of all our other thread can this be done easily?
Below is the bit in our php file that opens the whole data.txt file (if its any help)
<?php
$file_loc = "data.txt";
$file = fopen($file_loc, "r");
if(!$file)
{
echo "<p>Error: Unable to open $file_loc.</p>";
}
else
{
while(!feof ($file))
{
$line = fgets($file, 1024);
echo $line;
}
}
?>