monkeybidz Posted May 6, 2006 Share Posted May 6, 2006 I have a variables being passed from another page to an email script:[b]$invoice_num[/b] & [b]$description[/b]In some cases, the results for this variable will require more than one row. How do i do this?Currently sending email like this:Example: Invoice Number Description-----------------------------------------------------------123456789 item i am selling 1I want to make a new row if more than one Invoice number is available.Example:Invoice Number Description-----------------------------------------------------------1234567809 - item i am selling 11234567810 - item i am selling 21234567811 - item i am selling 3Thanks in advance. Quote Link to comment Share on other sites More sharing options...
tjhilder Posted May 6, 2006 Share Posted May 6, 2006 could you post the code you are using? (although if this is a big amount of code, it's recommended that you save it to a txt file on the server you host your website and then link to it.) Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted May 6, 2006 Author Share Posted May 6, 2006 It sends all the info OK, but would like it if the $invoice_num & $description create a new row with sorted invoice number, and description. Currently i need to send an invoice manually each time for each invoice, but i am trying to get to where i can just manually send all invoices for that customer at once at the end of the month. Heres the code:<?mail ("$email", 'Your Invoice for '."$month".'/'."$year", "This is a summary of the amount due for $month/$year.You have an amount due of $$total_due for the following item(s) listedat $website_name. Invoice Number Description---------------------------------------------------------------$invoice_num - $descriptionThis amount is due by $due_date day of this month.If payment is not receieved by the due date, your account will be suspended.If you have any questions, please contact:$admin_email",'From:'."$website_name". '<'."$admin_email".'>');?> Quote Link to comment Share on other sites More sharing options...
tjhilder Posted May 7, 2006 Share Posted May 7, 2006 since i've not done this before I'm not totally sure what to do, but an idea might be to create a loop before the mail() function to get the infomation, then create it so that it gets sent into the same varible?kinda like this:[code]$email_discription = "Invoice Number Description\n---------------------------------------------------------------\n";$email_discription .= "invoice 1\n";$email_discription .= "invoice 2\n";$email_discription .= "invoice 3\n";[/code]then you could replace[code]Invoice Number Description---------------------------------------------------------------$invoice_num - $description[/code]with $email_discription.see if you can figure that out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.