I have problem when I try to edit contents of text file in form fields and saving edited result into text file. My edit front page code look like this:
<?php
$handle = fopen("file.txt", "r");
if($handle)
{
while (!feof($handle)) {
$contents = fgets($handle);
$first_token = strtok($contents, '=');
$second_token = strtok('=');
?>
<form action="match.php" method="post" enctype='multipart/form-data'>
<p><input type="text" name="net" value="<?php echo $first_token; ?>"/>
<p><input type="text" name="ip" value="<?php echo $second_token; ?>" />
<?php
}
}
fclose($handle);
?>
<p><input type="submit" name="submit" value="Save" /></p>
</form>
Code load contents of text file into form fields. But when I try to save contents to text file then my code save only two last form fields but other fields it ignore. How I can save all contents of form fields to text file.