Here are a few things I see:
for($i = 1; $i <= $numofpages; $i++) {
if ($pagesstart <= $i && $pagesend >= $i) {
if ($i == $page) {
echo "<b>[$i]</b> ";
}
else {
echo str_replace("%page", "$i", '<a href="'.$link.'">'.$i.'</a> ');
}
}
}
can be rewritten to be:
for($i = $pagesstart; $i <= $pagesend; $i++) {
if ($i == $page) {
echo "<b>[$i]</b> ";
}
else {
echo str_replace("%page", "$i", '<a href="'.$link.'">'.$i.'</a> ');
}
}
Remove teh spaces between function names and parethensis:
$db=mysql_connect ("BLOACKED", "BLOCKED", "BLOACKED") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("db154983921");
Should be a number, not a string:
$pp = "40";
// Should be:
$pp = 40;
This:
if (!isset($_GET['page'])) {
$page = 1;
}
else {
$page = $_GET['page'];
}
Can be rewritten as:
$page = (!isset($_GET['page']))?1:$_GET['page'];
Always use an or die() statement:
$result = mysql_query($query);
This type of line doesn't need to be in quotes:
echo"$r[filename]";
and should be rewritten as:
echo$r['filename'];
Start with those, see what that gets you...