I've found the solution. This is the script. Now it works as I expect. It generates a table with a text box (or other control) in each row keeping the information of the older rows adding a new record in blank:
<head>
<title>Example PHP</title>
</head>
<body>
<form method="post">
<table border=1>
<?php
for($i=1; $i<=$fields; $i++) {
?>
<td><tr>
<input type="text" name="field_<?php echo $i; ?>"
value="<?php
// This is the changed code
$f='$field_'."$i";
eval("echo $f;");
?>
" >
</td></tr>
<?php } // end for
?>
</table>
<input type="submit" value="New record"
onClick="form.action='<?php echo "$PHP_SELF?fields=".++$fields; ?>'; form.submit(); " >
</form>
</body>