Jump to content

Parts of page disappearing


almightyegg

Recommended Posts

I have a message board page that displays one page of one forums' messages using pagination. It all works really well unless there are no messages in which case nothing below the bit in the pagination code that echoes 'first prev [1] [2] ... next last' is shown.

 

Below this section I have the form to add a thread and some links, but they aren't shown because of this problem in the script. This means that the first message in each forum can only be put in from PhpMyAdmin or by a script I make specifically for it.

 

<?

echo "<center>";
if($page > 1){ 
    $prev = ($page - 1); 
    echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=1'>First</a> "; 
    echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$prev'>Prev</a> "; 
} 
for($i = ($page - 2); $i <= ($page + 2); $i++){ 
  
   if (($i >= 1) && ($i <= $total_pages)) { 
     echo ($page == $i) ? "[$i] " : "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$i'>$i</a> ";  
   }  
} 
if($page < $total_pages){ 
    $next = ($page + 1); 
    echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$next'>Next</a> "; 
    echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$total_pages'>Last</a>"; 
}
echo "</center>";

?>

 

Nothing below that is shown and it echoes no errors...

Link to comment
https://forums.phpfreaks.com/topic/56990-parts-of-page-disappearing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.