Jump to content

Pagination problem


aloy789

Recommended Posts

I ve created a search engine that extracts information from an estate agent site(www.rightmove.co.uk). I am only able to retrieve the results of the first page only. I need to create my own pagination so when I click on the second page it gets results from the second page of the site and displays them onto my interface. This is the code that extracts results (webfetch1.php)

<p>The info from Rightmove.co.uk for Location : 

  <b><? echo $_REQUEST["T1"]; ?></b> is

  <?
//echo $_REQUEST['lo_u'];
$locationID= explode("^",$_REQUEST['lo_u']);
$res = str_replace(", ","%2C+",$locationID[1]);
$res1= str_replace(" ","+",$res);

//print_r ($locationID);
if(isset($_GET['pagenum'])) {
$pagenum = $_GET['pagenum'];
} else {
$pagenum = 1;
}
$query = "http://www.rightmove.co.uk/action/EmailUpdatesAction?lo_n=". $res1."&se_c=1&nh_st=1&lo_u=". $locationID[0]."&lo_t=0&tr_t=".$_REQUEST['choice']."&se_t=1.0&mi_p=&ma_p=&p_t=2&fr=3&pa_n=$pagenum&sc_id=3971107&co_t=1&eventsubmit_dosearch=1";
//echo $query;
$content=file_get_contents($query);
if ($content == "")
{
       echo "No Properties found for this criteria";
}
else
{

$c = explode('Print',$content);
$d= explode('Refine your criteria', $c[2]);
//print_r ($d[0]);

$remove = array("<li>","</li>");
$result = str_replace($remove," ",$d[0]);
//print_r ($res);
echo $result;
}

?>
</p>

 

I made this hyperlink for the second page but it doesnt work I am getting 404 error message. This is the code for the link:

<p><a href="webfetch1.php&pagenum=2&<? echo $_GET['T1']; ?>&choice=<? echo $_GET['choice']; ?>&lo_u=<? echo $_GET['lo_u']; ?>&submit=submit">2</a></p>

 

Anybody knows whats wrong with the link? Help would be much appreciated.

 

Thanks in advance,,,

Link to comment
https://forums.phpfreaks.com/topic/105302-pagination-problem/
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.