hi! its simple....just name the textbox as 'firstname[]' ..............this brackets tells its an array........so you will get array of firstname when form is submitted......... eg... form.php will be like this __________________________________________________________________ <FORM METHOD=POST ACTION="submit.php"> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="submit"> </FORM> __________________________________________________________________ and submit.php will be......... _______________________________________________________________ <?php print_r($firstname); /********* or **********/ for ($i=0;$i<count($firstname);$i++) { echo $firstname[$i]; } ?> _________________________________________________________________ regards vaibhav.
On Mon, 24 Mar 2003, vaibhav wrote:
its simple....just name the textbox as 'firstname[]' ..............this brackets tells its an array........so you will get
[snip]
<FORM METHOD=POST ACTION="submit.php"> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="text" NAME="firstname[]"><BR>
[snip]
Uh, I don't know php, but I don't think HTML allows arrays. The above looks suspiciously like HTML.
Philip
On Mar 24, 2003 at 10:40, Philip S Tellis wrote:
On Mon, 24 Mar 2003, vaibhav wrote:
<FORM METHOD=POST ACTION="submit.php"> <INPUT TYPE="text" NAME="firstname[]"><BR> <INPUT TYPE="text" NAME="firstname[]"><BR>
Uh, I don't know php, but I don't think HTML allows arrays. The above looks suspiciously like HTML.
True, but HTML probably doesn't care. Whether it is valid as an HTML form, that's a different question. But PHP IIRC does the right thing.