Hello all,
I am working on an upload script. This one is taken straight from php.net. I tried to get it to work but can't seem to. Could you help out?
This is the code:
<?php
$uploads_dir = 'file:///PETBookPro09/Users/petuser1/Desktop/';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
}
?>
This is the error message it says:
Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/....(stuff).../uploader1.php on line 142
I would appreciate any help at all! Thanks