943,568 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2087
  • PHP RSS
Feb 8th, 2006
0

Next page creator

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
namit is offline Offline
44 posts
since Jun 2005
Feb 12th, 2006
0

Re: Next page creator

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>";
Reputation Points: 10
Solved Threads: 0
Newbie Poster
laurente is offline Offline
2 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Simple Banned Words Filter
Next Thread in PHP Forum Timeline: php_write in php5 gives cannot read error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC