PHP上传文件名未打印
这很简单,应该可以工作,但是不行,所以我显然在某个地方做得很努力。提交表单后,应打印上传的文件名PHP上传文件名未打印,php,printing,upload,filenames,Php,Printing,Upload,Filenames,这很简单,应该可以工作,但是不行,所以我显然在某个地方做得很努力。提交表单后,应打印上传的文件名 <?php if (isset($_POST["submit"])) { $name_of_uploaded_file = $_FILES['uploaded_file1']['name']; print($name_of_uploaded_file); } ?> <form id="contactform" action="<
<?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>
您需要在表单打开标记上设置内容编码类型
<form enctype="multipart/form-data" action="uploader.php" method="POST">