quote:
Originally posted by hmaster
This is some sample upload code I used, I think it's because you havn't used the $_FILES variables
code:
#upload
if(@$_POST['submit']) {
$target_path = "gallery/images/";
$filename = basename($_FILES['uploadedfile']['name']);
$filename = str_replace(" ", "", $filename);
$target_file = $target_path . $filename;
if(empty($filename) || $filename == " ") {
header("Location: upload.php?error=1");
} elseif(file_exists($target_file) && @$_POST['ovrwrtf'] != "on") {
header("Location: upload.php?error=3");
} else {
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_file)) {
header("Location: img.php?filename=$filename");
} else {
header("Location: upload.php?error=4");
}
}
}
?>
I think move_uploaded_file() works better than copy() when uploading
Horrible use isset() instead of just ignoring the notice