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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.