refael Posted October 25, 2009 Share Posted October 25, 2009 Hi everyone, As a newbie in php I am quite familiar how to submit a bunch of form input fields to an email (form to email). Here is something I am struggling with: I have a table where the data in the fields are injected (spared) from a database. You see, the table is an actual php code that generates the rows/columns using “for each loop” so the fields name or ID are the same in each row. So I have several rows where each row ends with a “submit” button. What I need to do is once the user click the submit button in a certain row to submit the data to an email. I know how to write the code but how I can determine which filed ID or name to collect as they are all the same? I am not sure how can I collect the fields only from a certain row to an email? Can someone help me understand how to do it? Many many Thanks! Link to comment https://forums.phpfreaks.com/topic/178886-table-data-fields-to-email/ Share on other sites More sharing options...
.josh Posted October 25, 2009 Share Posted October 25, 2009 since you didn't actually post any code, this is just a guess...you probably have something like this: while($row=mysql_fetch_.....) { ...name="blah[]"... } Key thing there is that you just have [] for it to auto-generate the next element. Instead of doing that, put the id in there: blah[$row['id']] then when user presses the submit button, you will know which id to query for based off the key in blah Link to comment https://forums.phpfreaks.com/topic/178886-table-data-fields-to-email/#findComment-943757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.