View Single Post
  #5 (permalink)  
Old Jul 22nd, 2006, 08:06
AdRock's Avatar
AdRock AdRock is offline
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Pagination with PHP and switch statement

Thanks Gee Bee, I did what you suggested and made a change of my own and now it works.

I do have another question you may be able to help with though.

This is the change I made from $limit = 10 to $limit = 2 becuase my news items can be quite long so I only want 2 per page
PHP: Select all

 //set default if: $limit is empty, non numerical, less than 2, greater than 50 
if((!$limit)  || (is_numeric($limit) == false) || ($limit 2) || ($limit 50)) { 
     
$limit 2//default 
How do I edit these hyperlinks or do i not have to?
PHP: Select all

//Results per page: **EDIT LINK PATH** 
echo("   
<a href=?page=newsitem&limit=10&amp;pagenum=1></a> 
<a href=?page=newsitem&limit=25&amp;pagenum=1></a> 
<a href=?page=newsitem&limit=50&amp;pagenum=1></a>"
); 
Thanks for all your help helping me out
Reply With Quote