i am very new to php, and having problem with the file upload, can someone help??
this is my form
<html>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>
and thsi is my upload.php
<?
$target_path =realpath( dirname( FILE ) ) . "/uploaded_invoices_dir/";
if ($_FILES['uploaded_file']['error'] == 0)
{
$target_path .= $_FILES['uploadedfile']['name'];
$result=move_uploaded_file($FILES['uploadedfile']['name'], $target_path);
echo $result;
if($result==true)
{
echo "The file ". basename( $FILES['uploadedfile']['name']).
" has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
}
?>