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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.