How to put the image from the url to a folder the right way in php?
<pre><code>    &lt;?php
$img = 'http://ecx.images-amazon.com/images/I/41pg1dHauUL._SL75_.jpg';
$target_path = 'product-images/';
$target_path= $target_path.basename($img);

if(move_uploaded_file($img,$target_path)){
    echo '&lt;br&gt;Success.';
}
else {
    echo '&lt;br&gt;Error.';
}
?&gt;
</code></pre>

<p>I don't know what is wrong, I think my path is correct. </p>
