Birde bunu deneyin
<?php
$url = $_POST["link"];
$uzanti=substr($url,-4);if($uzanti==".png" or $uzanti==".jpg" or $uzanti==".gif"){$isim=rand(0,99999).$uzanti;$hedef1="resimler/".$isim;touch($hedef1);$al=file_get_contents($url);$kaydet=file_put_contents($hedef1,$al); move_uploaded_file($_FILES["$url"]['tmp_name'],"resimler/".$isim);}

?>