Welcome, guest!  |   Login  |  
Close

Login to Your Account


  |  » Forgot your password?
Join

Notices

Thread: Pagination

 
Tools Search
  #1  
Old January 2nd, 2008, 03:16 AM
Action Jackson - King of the World
Join Date: January 18th, 2005
Posts: 2,206
Send a message via AIM to jackson992 Send a message via MSN to jackson992
I am having a heck of time doing pagination for pages for some reason. I can't decide whether I should just do a next and prev or display all the page numbers.

This is what I have for code so far:

<table width=100% align=center>
<tr>
<td align=center>

<?
$limit=6;
if($page != 1){
$pageprev = $page-1;
}

$numofpages = ($totalrows / $limit);
for($i = 1; $i <= $numofpages; $i++){
if($i == $page)
echo($i." ");
else
echo("<a href=\"index-links.php?interest=$interest&page=$i\"><font size=+1>$i</font></a> |
");
}

if(($totalrows % $limit) != 0){
if($i == $page)
echo(" ");
else
echo("<a href=\"index-links.php?interest=$interest&page=$i\"><font size=+1>$i</font></a> |
");
}

if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page+ 1;

}else

mysql_free_result($result);

?>

</td>
</tr>
</table>



For some reason it is not displaying the pages at all and I can't seem to figure out why. Anyone have any ideas?
__________________
Jack Mitchell
Travel Gifts | Easy Auto Parts Online | Clothing To Go
  #2  
Old January 2nd, 2008, 07:46 AM
Member
Join Date: January 1st, 2008
Location: Buffalo, NY
Posts: 84
Send a message via AIM to esnagel Send a message via Skype™ to esnagel
Look at http://pear.php.net/package/Pager - while it may take a while to get set-up, once you have it working, it's very easy to use and customize.
Reply

Tools Search
Search:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pagination not working with PHP Lazer11 PopShops 9 December 10th, 2007 05:52 PM
Pagination change msladybug PopShops 7 November 29th, 2007 09:26 AM
advanced pagination jackson992 Programming / Datafeeds / Tools 2 October 10th, 2004 01:33 AM
Using webmerge for pagination dak142 WebMerge (Fourthworld.com) 1 July 22nd, 2004 06:23 AM

X

Welcome to ABestWeb.com

Create your username to jump into the discussion!

ABestWeb.com is the largest affiliate marketing community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?



Content Relevant URLs by vBSEO ©2011, Crawlability, Inc.