Jump to content

page issues


jwcsk8r

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/42824-page-issues/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/42824-page-issues/#findComment-208164
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.