For some reason, when using this code the file it outputs is just called ".jpg".
<?
$title = $GET['title'];
$url = $GET['url'];
$ourFileName = $title.jpg;
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
$ch = curl_init ("http://www.address.com/url=$url");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$rawdata=curl_exec ($ch);
curl_close ($ch);
$fp = fopen("images/$ourFileName",'w');
fwrite($fp, $rawdata);
fclose($fp);
echo ("<img src=images/$ourFileName>");
?>
Pretty sure it has to do with declaring $ourFileName, any help would be appreciated.