I’m not sure why your code is not working.. ..but can you try this form below. I have taken your form and removed all the PHP. This should still submit a file to tyo.php
..
<form enctype="multipart/form-data" action="tyo.php" method="post">
<input type="hidden" name="test" value="123"/>
<input type="file" name="attac" value="" />
<input type="submit" name="submit" value="save" />
</form>
Your code.. ..tidy’d up a bit
<form enctype = "multipart/form-data" action="tyo.php" method="POST">
<input type="hidden" name="File_no" value="<?= $emp_no ?>"/>
<input type="hidden" name="date" value="<?= $date ?>"/>
<input type="hidden" name="day" value="<?= $day ?>"/>
<input type="hidden" name="record_id" value="<?= $record_id ?>" />
<input type="hidden" name="method" value="<?= $add_absence ?>" />
<td style="text-align:center">
<select name="ab_ex">
<?php
$sql_absence = "SELECT * FROM `ex_ab_types`";
$result_absence = $mysqli->query($sql_absence);
if ($result_absence->num_rows > 0){
while($row_sql_absence = $result_absence->fetch_assoc()){
echo "<option value="$row_sql_absence[EX_ID]">$row_sql_absence[DESC]</option>";
}
}
?><select>
</td>
<td>
<input type="file" name="attac" value="" />
</td>
<td style="text-align:center">
<input type="submit" style="margin-bottom: 0px;" value="save" class="btn btn-primary" />
</td>
</form>
1
solved can’t upload file , all element submit but the file element not