zhang zhang - 1 month ago 13
HTML Question

bootstrap html post picture no value

I'm using bootstrap, and want to send a picture using html form by post.
But I can't get the attribute of the picture while I can get the data of other types.
My code are as follows:

<form enctype="multipart/form-data" action="insertPublish.php" method="post" name="changer" role="form">
<div class="form-group">
<label for="activity_name">name</label>
<input name = "activity_name" type="text" class="form-control" id="activity_name" placeholder="please input the name">
</div>

<div class="form-group">
<label for="activity_describe">description of the activity</label>
<textarea name="activity_describe" class="form-control" id="activity_describe" rows="9"></textarea>
</div>

<div class="form-group">
<label for="inputpicture">please upload picture</label>
<input accept="image/jpeg" name = "image" type="file" id="inputpicture">
<p class="help-block">please upload file in jpeg format</p>
</div>
<button type="submit" class=""btn btn-default>submit</button>
</form>


Here the link of the website. The button at the bottom is for picture upload.(sorry that the website is in Chinese).
And redirect the link uses the code following to debug and can't see the value image.


var_dump($_POST)


I find some related link but I still can't solve the problem.

I wonder if it is the problem of
enctype="multipart/form-data"
or
jquery

Answer

The $_POST variable consists of posted data, however files are added to the $_FILES variable.