zhang zhang - 1 year ago 84
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 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 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>
<button type="submit" class=""btn btn-default>submit</button>

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.


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

I wonder if it is the problem of

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download