Page 1 of 1

Condensing all my form detail

Posted: Wed Apr 22, 2009 8:27 am
by Addos
I’m trying in insert several details into my database using a form populated from a loop however at the moment if I run the code below I obviously will get several forms out putting to the browser when in effect I only want the entire form detail but only one textarea and submit button showing. Can anyone advise me as to what is the best way to approach this?
Thank you

Code: Select all

<form action="<?php echo $editFormAction; ?>" method="post" name="form11" id="form11">
<?php do { ?> 
<input type="hidden" name="from_name" value="<?php echo $row_GetEmails['f_name']; ?>" size="32" />
<input type="hidden" name="from_mail" value="<?php echo $row_GetEmails['email']; ?>" size="32" />
<input type="hidden" name="to_email" value="info@me.com" size="32" /></td>
<input type="hidden" name="MM_insert" value="form1" />
<input type="submit" value="Insert record" />
<input type="text" name="subject" value="" size="32" />
<textarea name="details" cols="50" rows="5"></textarea>
<?php } while ($row_GetEmails = mysql_fetch_assoc($GetEmails)); ?> 
</form>

Re: Condensing all my form detail

Posted: Wed Apr 22, 2009 9:39 am
by temidayo
Take the textarea and the button out of the do loop

Re: Condensing all my form detail

Posted: Wed Apr 22, 2009 9:47 am
by Addos
Yeah I had tried that but it just adds the last item in the loop to the database and ignores all the other entries. I'll keep at it and see if I can come up with something else.
Thanks