Re: form challenge
| From: | Matt McClanahan | Date: | Mon, 10 Jul 2000 17:28:43 +0000 |
| Subject: | Re: form challenge | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5765@lists.php.net to get a copy of this message | ||
On Mon, 10 Jul 2000, B. Keith Murphy wrote:
> I have a little programming problem. I need to develop a form with a
> variable number of fields each time it is displayed. Basically it
> should loop through $x (user specified) number of times printing out a
> text box/submit button each time. Can someone send some basic help as
> to how to do this or point me to a reference. I don't think I have ever
> seen this done. Thanks!!
Sounds like you just want to repeat a block of code $x times.
<? for( $i = 0; $i < $x; $i++ ) { ?>
<form method="post" action="<? echo $PHP_SELF ?>">
<input type=text> <input type=submit>
</form>
<? } ?>
Something like that?
Matt