<?php
if (!$submit) {
?>
:
<body>
<form action="thisFormURL" method="post">
<select name="fields">
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
</select>
<input type="submit" value="Go!" name="submit">
</body>
</form>
<?php else {?>
:
<body>
<?php
for ($i=0;$i<$fields;$i++) {
echo "<input type=\"text\">";
}
?>
</body>
You'll probably need to pop in some other HTML in there, but this should give you roughly what you need.
Please also note that you should target the same page in the form (i.e. if you name the file form.php, you should target form.php).
Cheers,
David Grant