问题是,每当我加载页面时,我总是要输入所有字段,无论如何,每当我第一次加载页面时,是否可以绕过它。
<form action="brand_upload.php" method="post" enctype="multipart/form-data">
<label for="file">Filename(logo):</label>
<input type="file" name="file" id="file"><br>
<br>Brand:<input type="text" name="brand">
<br>Serial No.:<input type="text" name="serial_number">
<input type="submit" name="submit" value="Submit">
<?php
if (isset ($_POST['submit']) && isset($_POST['brand']) && isset($_POST['serial_number']) && !empty($_POST['brand']) && !empty($_POST['serial_number'])){
{
echo 'do something';
}
else
{
echo '<br>enter all fields';
}
?>
</form>