I am testing a php code of file uploading. Here is the form:
<form action="C:/xampp/htdocs/php/upload.php" method="post" enctype="multipart/form-data">
<p>Browse File</p>
<p><input type="file" name="file" id="file" /></p>
<p><input type="submit" name="submit" value="Submit" /></p>
</form>
and here is the upload.php file:
<?php
if($_POST['submit']){
$upload_folder = 'C:/xampp/htdocs/php/uploads/';
move_uploaded_file($_FILES['file']['tmp_name'], $upload_folder.$_FILES['file']['name']);
echo 'File uploaded successfully';
}
?>
But this doesn't upload any file. What is the problem here?