I am currently having problems connecting to a url using fopen.
It returns the following error message:
I am able to conect to the same site, but on a different page further up my script, and I close the connection once finished. But when I try and connect again to the same url, but a diferent page, i get the above error.
Does anyone know what's going on with it?! I am able to connect fine if I only have one connection on the page
Here is my PHP code:
EDIT: $url[1] contains: /www/dealerservices_photoad.asp?abname=johnhorton&pageid=1&id=200444168728845
<?php
$monkey = "http://atsearch.autotrader.co.uk" . $url[1];
// Now with that url, I can go off to that page and retrieve the picture to display on my site
$handle2 = fopen($monkey,"r");
if($handle2)
{
$i = 0;
while($line2 = fgets($handle2,1024))
{
$pageData[$i] = $line2;
$i++;
}
fclose($handle2);
for($i=0;$i<count($pageData);$i++)
{
$image = strstr($pageData[$i],"<img src=\"");
if($image != "")
{
// Have got the image url, so now print to screen
echo $image;
}
}
}
else
{
echo "failed to retrieve picture<br><br>";
}
?>