Hi,
I’m having a problem getting a curl to work on a thumbnail script I have.
<?php
$domain = $_SERVER['HTTP_HOST'];
$fullimageurl = "http://$domain/images/BCANFALL.JPG";
$fullimageurl2 = "http://$domain/images/noimagefound.jpg";
$c = curl_init($fullimageurl);
if (curl_getinfo($c, CURLINFO_HTTP_CODE) === 200) {
$imagesurl = $fullimageurl;
} elseif (curl_getinfo($c, CURLINFO_HTTP_CODE) === 404) {
$imagesurl = $fullimageurl2;
} else{
$imagesurl = $fullimageurl2;
}
curl_close($c);
?>
The problem is that the fullimageurl does not exist and should error with the 404 above, but it doesn’t. All the other files that do exist come up under the else and not under the 200 OK part. I have no clue what I am doing wrong and see no error with the above.
Thanks,
Kevin