Re: Result Table Into EMail

From: Date: Thu, 15 Jun 2000 02:15:33 +0000
Subject: Re: Result Table Into EMail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1904@lists.php.net to get a copy of this message
On 14 Jun, Don Smith wrote: > I'm stuck here... > > I have a site where a user logs in and a query results are printed to a web > page table listing their product order. This list could consist of dozens of > lines, each with an input field so that the user can list the quantity of > each product they are ordering. So far so good. Now, I want to get that > information into an email, but a fixed array won't work because the number > of rows in a given result will vary. Here's the breakout of each row that's > printed to the web page at http://www.dallasbureau.com: > > echo > "<TR><TD>$custid</TD><TD>$item</TD><TD>$des</TD> > <TD>$uom1</TD><TD>$price1</TD><TD>"; > > echo "<input type=\"text\" value=\"0\" name=\"qty\" > size=\"3\">"; > > echo "</TD><TR>\n"; By the time you have this on the browser, the script has finished executing; you have no (PHP) way of knowing, in this script at this time, what number the user is going to enter in the qty field. You're going to have to pass it on to another (maybe the same) script for further processing. Maybe you could add a check button for each $item and track the item via it's unique ID (you do have one?). Then you could say pass the custid, item id and qty to the next script, where you would then check that there is a qty for each item and then compose an email; you'd have to go back to the db to get the details for each item. The tab can be inserted like: $line_in_mail = $item . "\t" . $des . "\t" . $whatever_else ; > > Now, I need to put each line in an email message along with the quantity the > user has typed in. I certainly know how to user the variable $qty in the > mail() function, but here I need an array I would think since this line will > be repeated a hundred times or so listing the products the user can choose > from, but I can't figure out how to create the array and then display the > array in the email message when the rows can be of a variable number. to add > to the complexity, each variable needs to be seperated by a tab character. > The merchant will then copy/past the tab-delimited message into a > spreadsheet. > > Any help would be greatly appreciated. > > Don Smith > NewsVideo.com > Very brief summary - hopefully that hasn't confused you too much? Cheers -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#1904) next »