0

I have created a that is supposed to have an input of type file and a submit button for uploading that file. My problem is that myfile is not displayed in the web browser but the submit button. Can you please help me to find the misstake.

echo "<form action='upload.php' method='post' enctype='multipart/form-data'> 
        <imput type='file' name='myfile'/>
        <input type='submit' value='Ladda upp'/>
        </form>";
4

2 回答 2

3

一双额外的眼睛可以帮助:

<imput type='file' name='myfile'/>
  ^

除此之外,您可以直接在代码中输入 HTML,如下所示:

<?php

    // some code ...

?>

<form action='upload.php' method='post' enctype='multipart/form-data'> 
<input type='file' name='myfile'/>
<input type='submit' value='Ladda upp'/>
</form>

尽可能将您的 HTML 与实际代码分开总是更好。

于 2013-09-07T12:18:59.160 回答
0

Html 从未发明过<imput>标签。这是

<input ='file' name='myfile'/>
  ^
  See see see
于 2013-09-07T12:21:56.220 回答