Thats for one of the files but it's pretty much the same in all of them. I tried it on my mates server and it all worked ok so i', unsure wat is wrong. - Heres the paste of it:
http://pastesite.com/4756CODE
<table cellpadding="0" cellspacing="5">
<tr>
<!--Recent Headlines-->
<td><?php recentnews(1); ?> </td>
</tr>
<tr>
<td><?php recentnews(2); ?> </td>
</tr>
<tr>
<td><?php recentnews(3); ?> </td>
</tr>
<tr>
<td><?php recentnews(4); ?> </td>
</tr>
<tr>
<td><?php recentnews(5); ?> </td>
</tr>
<tr>
<td><?php recentnews(6); ?> </td>
</tr>
</table>
<?php
function recentnews($row){
$news = fopen("data/news.txt","r") or exit("Unable to open file");
$newscount = 0;
while (!feof($news))
{
$line = fgets($news);
$strongpos = strpos($line, "</strong>");
$boldpos = strpos($line,"<strong>");
if ($strongpos){
$header[$newscount] = substr($line, $boldpos, $strongpos + 9);
$newscount++;
}
}
fclose("data/news.txt");
switch ($row) {
case 1:
echo ("<a href='info.php#news" . ($newscount). "'>". $header[0]. "</a>");
break;
case 2:
echo ("<a href='info.php#news" . ($newscount - 1) . "'>". $header[1]. "</a>");
break;
case 3:
echo ("<a href='info.php#news" . ($newscount - 2) . "'>". $header[2]. "</a>");
break;
case 4:
echo ("<a href='info.php#news" . ($newscount-3) . "'>". $header[3]. "</a>");
break;
case 5:
echo ("<a href='info.php#news" . ($newscount-4) . "'>". $header[4]. "</a>");
break;
case 6:
echo ("<a href='info.php#news" . ($newscount-5) . "'>". $header[5]. "</a>");
break;
default:
break;
}
}
?>