I have a select box with some urls in it (dynamic). I want to upload/copy those images to a folder (with 0777 permission). Somehow it does nothing. Not getting any errors but the images aren't being copied. Whats wrong with my code?
echo '<select name="photoselect[]" multiple="multiple"></select>';
echo '<form action="" method="post"><input type="submit" name="CopyImages"/> </form>';
$target_dir = "upload/"
if(isset($_POST['CopyImages']))
foreach ($_GET['photoselect'] as $photourl) {
$photoname= basename($photourl);
copy($photourl, $target_dir.'/'.$photoname);
}