jwcsk8r Posted March 15, 2007 Share Posted March 15, 2007 When I run this locally using MAMP server, it works great. But when it is uploaded to my hosting company (hostmonster) it doesn't work at all. The navigation for the links using $PHP_SELF(I have also tried $_SERVER[’PHP_SELF’]) seems to be broken. What might be the issue? <?php if ($page != 0) { // Don't show back link if current page is first page. $back_page = $page - $limit; echo("<a href=\"$PHP_SELF?query=$query&page=$back_page&limit=$limit\">back</a> \n");} for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page){ echo("<b>$i</b>\n");} // If current page don't give link, just text. else{ echo("<a href=\"$PHP_SELF?query=$query&page=$ppage&limit=$limit\">$i</a> \n");} } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link. $next_page = $page + $limit; echo(" <a href=\"$PHP_SELF?query=$query&page=$next_page&limit=$limit\">next</a>");} ?> Here is a link also to the problem... http://jwcsk8r.com/iaredrunk/multiple_pages.php Much Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/42824-page-issues/ Share on other sites More sharing options...
interpim Posted March 15, 2007 Share Posted March 15, 2007 try changing $PHP_SELF to multiple_pages.php Quote Link to comment https://forums.phpfreaks.com/topic/42824-page-issues/#findComment-208014 Share on other sites More sharing options...
boo_lolly Posted March 15, 2007 Share Posted March 15, 2007 interpim is right. your host may have turned GLOBALS off in your virtual php.ini file. this is a common security feature hosting companies practice. Quote Link to comment https://forums.phpfreaks.com/topic/42824-page-issues/#findComment-208068 Share on other sites More sharing options...
jwcsk8r Posted March 15, 2007 Author Share Posted March 15, 2007 I have changed the code to... <?php if ($page != 0) { // Don't show back link if current page is first page. $back_page = $page - $limit; echo("<a href=\"multiple_pages.php?query=$query&page=$back_page&limit=$limit\">back</a> \n");} ?> but it still doesn't seem to be working??? I also tried turning Register_Globals to On in the php.ini file just to test it on the server and that didnt work either? I am so confused. Quote Link to comment https://forums.phpfreaks.com/topic/42824-page-issues/#findComment-208164 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.