So ive tried this a few times and gave up, and im attempting to do it again but running into the same problems =/
I wanna be able to download and save an image like this.
http://www.socom.com/en-us/Clan/Badge?name=the+potheads (You will need to verify age before you can view)
My problem is when you goto the link it goes to another url. This is the last thing i tried, but i just get a blank image.
$url = "http://www.socom.com/en-us/Clan/Badge?name=the+potheads";
$ch = curl_init();
$fh = fopen("whatever.png", "wb");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
curl_close($ch);
fclose($fh);