Jump to content

Php help please


FUNKAM35

Recommended Posts

 

Hi, I need the following code altering.

Page one of my real estate listings when you got to it through the main pages is

real_estate.php?province=Turin&country=Italy

 

However when you got to page 2 from the code below and then go back to page 1 it is

real_estate.php?page=1&province=Turin&country=Italy&range=

 

 

This means there are 2 duplicate pages for the search engiens so I need some big help to alter the code below to go to

 

real_estate.php?province=Turin&country=Italy for PAGE 1

any pages 2 and more to go to

real_estate.php?page=2&province=Turin&country=Italy&range=

 

Here is the code thanks in advance

 

// build previous link

if ($page > 1) {

$prev = ($page - 1);

echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&province=$province&country=$country&range=$range\" title='Previous $province properties'> << Previous </a> ";

}

for ($i = 1; $i <= $total_pages; $i++)

{

 

          if (($page)==$i)

          {

              echo "$i ";

          }

            else

          {

          echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i&province=$province&country=$country&range=$range\" title='More $province properties'> $i </a> \n";

            }

    }

// build next link

if($page < $total_pages){

$next = ($page + 1);

echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&province=$province&country=$country&range=$range\" title='More $province properties'> More $province properties  ></a> ";

}

 

}

echo "</div>\n";

Link to comment
https://forums.phpfreaks.com/topic/119026-php-help-please/
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.