Next page creator

Reply

Join Date: Jun 2005
Posts: 44
Reputation: namit is an unknown quantity at this point 
Solved Threads: 0
namit namit is offline Offline
Light Poster

Next page creator

 
0
  #1
Feb 8th, 2006
I have a list of files that are pictures but i want to have
<- previous next -> under each picture that goes to the next picture.

Was thinking maby should create an array of all the images and then echo out the array
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 2
Reputation: laurente is an unknown quantity at this point 
Solved Threads: 0
laurente laurente is offline Offline
Newbie Poster

Re: Next page creator

 
0
  #2
Feb 12th, 2006
I think it's not effective way if we create an array of all the images and then echo out the array.

Maybe you can use below algoritma (below are not working codes) :

$Page = $_GET['page'];
$ImagesPerPage = 10; //number of images per page

$StartImage = $Page * $ImagesPerPage;
$q = "SELECT * FROM table_images ORDER BY id ASC LIMIT $StartImage, $ImagesPerPage";

/*
Show your Images here
*/

//Paging here:
echo "<a href='$PHP_SELF?page=". ($page - 1) ."'>previous</a>";

echo "<a href='$PHP_SELF?page=". ($page + 1) ."'>next</a>";
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 1572 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC