PHP Uploaded Filename not printing
This is simple and should work but doesn't, so I'm obviously derping pretty hard somewhere. The uploaded file name should print after form submission.
<?php
if (isset($_POST["submit"])) {
$name_of_uploaded_file = $_FILES['uploaded_file1']['name'];
print($name_of_uploaded_file);
}
?>
<form id="contactform" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr>
<td>
<table>
<tr>
<td>
Attach Logo:
</td>
<td>
<input type="file" id="uploaded_file1" name="uploaded_file1" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<input name="submit" id="submit" type="submit" value="Send" />
</td>
开发者_开发技巧 </tr>
</table>
</form>
You need the content encoding type set on your form open tag.
<form enctype="multipart/form-data" action="uploader.php" method="POST">
精彩评论