i have the following html page:
<form action="image3.php" method="POST" enctype="multipart/form-data" onsubmit="return checkform(this);">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="file" name="imagefile" size="20" >
<input type="submit" value="Add" name="addIt" class="adminInputBox" onclick="return confirm('You are about to add a new Thread Listing. Is all Information is correct?');">
</form>
and PHP script:
//Check to make sure a file was selected.
//If selected - continue
if (is_uploaded_file($_FILES['imagefile'])) {
//change image name to all lower case
$imgname = strtolower($_FILES['imagefile']['name']);
//remove all spaces from image name
$imgname = str_replace(" ","",$imgname);
//check to see if file already exists
//If not - copy file and continue. Otherwise error out
if (!file_exists("../images/$imgname")) {
copy($_FILES['imagefile']['tmp_name'],"../mages/$imgname");
}
//Send back to page with variables
else {
header("Location: imagerror.php");
}
}
?>
the code seems to submit the image "ok" but when check the folder, the image can not be found... i have set the folder CHMOD to 777 (so there shouldn't be a permissons error)
can anyone see where im going wrong????
thanks