i am using curl and i am passing url, with page no=2 but it redirect to first page.i need your help please help me
example if i passed= http://itunes.apple.com/us/genre/mobile-software- applications/id6018?mt=8&letter=A&page=2#page
it redirect to= http://itunes.apple.com/us/genre/mobile-software- applications/id6018?mt=8&letter=A&page=1#page
<?php
$agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, "http://itunes.apple.com/us/genre/mobile-software- applications/id6018?mt=8&letter=A&page=2#page");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else{
echo $output = curl_exec($ch);
}
curl_close($ch);
?>
but it always redirect to first page I am not getting page 2 or given url.