Я хочу записать пользовательские вводы в текстовый файл, чтобы сохранить их, и если страница перезагружается, я хочу прочитать из файла, чтобы сохранить данные
Я пробовал много вещей, но ничего не работает, яновичок в php и я очень хорошо знаю, что я делаю, пожалуйста, помогите
io.php
<?php
$item = $_POST['item'];
$plu = $_POST['plu'];
$img = $_POST['img'];
$password = $_POST['password'];
include 'form.php';
echo "<tr>
<td><input type=checkbox></td>
<td> $item </td>
<td>$plu</td>
<td> <img src= alt= alt=\"\"> </td>
</tr>";
form.php
<?php
echo '
<form class="form-container" action="io.php" method="post">
<label for="name"><b>name</b></label>
<input id="user" type="text" placeholder="Enter Name" name="item">
<label for="name"><b>plu</b></label>
<input id="plu" type="text" placeholder="Enter Plue" name="plu">
<label for="fileupload"> <b>upload image</b></label>
<input id="img" class="btn" type="file">
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Manager Password" name="password">
<input type="submit" id="but" class="btn">add </input>
<button type="button" class="btn cancel" onclick="closeForm()">Close</button>
</form>';