Amman-DJ Posted April 1, 2007 Share Posted April 1, 2007 i have a php script that index content of other sites and the are link for the page ex: {1} {2} {3} ..etc i want to make a link that takes u direct to the next page i tried to open the file with macromedia DearmWeaver but it didn't detect the numbers of the pages as php code and i opened with frontpage and it works , but is there a way to make Next page link in html ? The link of the pages is like this ( go.php?page=3 ) anybody can help ? ??? Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/ Share on other sites More sharing options...
Amman-DJ Posted April 1, 2007 Author Share Posted April 1, 2007 Help Help Help Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/#findComment-219108 Share on other sites More sharing options...
AndyB Posted April 1, 2007 Share Posted April 1, 2007 read the tutorial on pagination Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/#findComment-219143 Share on other sites More sharing options...
neel_basu Posted April 1, 2007 Share Posted April 1, 2007 First Make An Array Like this $page[] = "page1_loc.php"; $page[] = "page2_loc.php"; $page[] = "page3_loc.php"; $page[] = "page4_loc.php"; $page[] = "page5_loc.php"; $page[] = "page6_loc.php"; And then <?php $curr_indx = array_search($_SERVER['PHP_SELF']); for($i=0;$i<=$curr_index;$i++) { $prev_page[] = $pages[$i]; } for($i=$curr_index;$i<=count($pages)-1;$i++) { $next_page[] = $pages[$i]; } ?> Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/#findComment-219170 Share on other sites More sharing options...
swatisonee Posted April 1, 2007 Share Posted April 1, 2007 Neel, wouldnt that array depend on knowing in advance how many pages the data would run into ? The pagination tutorial might be simpler . Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/#findComment-219190 Share on other sites More sharing options...
neel_basu Posted April 1, 2007 Share Posted April 1, 2007 Neel, wouldnt that array depend on knowing in advance how many pages the data would run into ? The pagination tutorial might be simpler . Sorry I didn't understand your question. Link to comment https://forums.phpfreaks.com/topic/45135-what-is-the-code-to-create-link-for-nextprevious-page/#findComment-219192 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.