Codexxx Posted September 6, 2008 Share Posted September 6, 2008 I have made my own pagination script which would work fine however i have an issue trying to get the current page for example: Usually someone would just do $_Get['page'].. however im doing it within my forums which the url is /index.php?module=forum&process=threadview&id=3&page=3 (the page=3 at the end is the page 3 of comments) i somehow need to get the 3 at the end.. $_get['page'] just doesnt work. is there another way to get '3', maybe cutting the url some how.. Any help appreciated Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/ Share on other sites More sharing options...
genericnumber1 Posted September 6, 2008 Share Posted September 6, 2008 it's $_GET, case sensitive. Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635097 Share on other sites More sharing options...
Codexxx Posted September 6, 2008 Author Share Posted September 6, 2008 soz i just typed it like that in my code its not $currentpage = $_GET['page']; index.php?module=forum&process=threadview&id=3&page=3 doesnt return 3 however the get for id works fine Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635098 Share on other sites More sharing options...
genericnumber1 Posted September 6, 2008 Share Posted September 6, 2008 do var_dump($_GET);die(); at the top of your script and post the output here. Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635099 Share on other sites More sharing options...
Codexxx Posted September 6, 2008 Author Share Posted September 6, 2008 array(4) { ["module"]=> string(5) "forum" ["process"]=> string(10) "threadview" ["id"]=> string(1) "3" ["page"]=> string(1) "3" } Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635101 Share on other sites More sharing options...
genericnumber1 Posted September 6, 2008 Share Posted September 6, 2008 $_GET['page'] IS set, as you can see from that output. It is a bug elsewhere in your code, post it here and we will try to help track down the bug if we can. If you prefer to fix it yourself, track the $currentpage variable you set the page to throughout your script and look for any problems. Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635104 Share on other sites More sharing options...
Codexxx Posted September 6, 2008 Author Share Posted September 6, 2008 ye found, thanks for that generic, great help hmm coz i was setting it in $page = $_GET['process']; at the top of my script and i was setting the get page in.. elseif ($page == 'threadview') { $currentpage = $_GET['page']; which it obviously didnt like.. so i moved to the top and worked fine... Link to comment https://forums.phpfreaks.com/topic/122983-solved-pagination-help/#findComment-635107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.