I have a form that takes in information from the user and saves the info and then displays it in the form field..
.
.
Form:
<form method="post" action="/core/process2.php" name="step2_form" target="_blank">
<div class="float_left">
<table class="form_step2">
<tr class="form_step2">
<td class="form_step2 title"><p class="form_text">File Date</p></td>
<td class="form_step2 input"><input type="text" class="box_form" name="file_date" value="<?php include($datadir."file_date.txt"); ?>"/></td>
</tr>
</table>
</div>
</form>
That is one of the approximately 300 inputs required... as you can see, to save the file, it calls process2.php which looks like this:
.
<?php
$files = array("file_date.txt", "supply_date.txt");
$input_name = array("file_date", "supply_date",);
for ($i = 0; $i <= 1; $i++)
{
$data = $_POST[$input_name[$i]];
$file = fopen ($directory.$files[$i], "w");
fwrite ($file, $data);
fclose($file);
}
?>
The problem I'm having is that sometimes, when the user presses the save button, it won't save the data or it will display the old data (the one that loaded with the page).
Any solutions to this? Unfortunately, this is not an online site so I can't link you to it..
.
.
.
Is there a better way of doing what I want to do??