Condensing all my form detail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Addos
Forum Contributor
Posts: 305
Joined: Mon Jan 17, 2005 4:13 pm

Condensing all my form detail

Post 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>
temidayo
Forum Contributor
Posts: 109
Joined: Fri May 23, 2008 6:17 am
Location: Nigeria

Re: Condensing all my form detail

Post by temidayo »

Take the textarea and the button out of the do loop
Addos
Forum Contributor
Posts: 305
Joined: Mon Jan 17, 2005 4:13 pm

Re: Condensing all my form detail

Post 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
Post Reply