I am in the process of developing a website where users can upload images, name them, and then submit the data to PHP code. Currently, I am using plain HTML and PHP for this project, but I intend to integrate the Bulma CSS library.
The current HTML code looks like this:
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="emote" id="emote">
<br>
Emote name:
<input type ="text" name="emotename" id="emotename">
<br>
<input type="submit" value="Upload Emote" name="submit">
</form>
Integration with the library means replacing the form
elements with div
. The revised code will resemble the following:
<form action="upload.php" method="post" enctype="multipart/form-data">
<div class="field">
<label class="label">Emote name</label>
<div class="control">
<input class="input" type="text" placeholder="Emote name..." id="emotename">
</div>
</div>
<div class="file">
<label class="file-label">
<input class="file-input" type="file" name="resume" id="emote">
<span class="file-cta">
<span class="file-icon">
<i class="fas fa-upload"></i>
</span>
<span class="file-label">
Choose a file...
</span>
</span>
</label>
</div>
<div class="field is-grouped">
<div class="control">
<input class="button" type="submit" value="Submit">
</div>
<div class="control">
<button class="button is-link is-light">Cancel</button>
</div>
</div>
</form>
Upon clicking Submit
, I encounter PHP errors stating: "You need to fill all the fields."