JimKI Posted November 11, 2010 Share Posted November 11, 2010 How do I e-mail a forms data with totals and also return a thank you page after hit submit on the form? Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 can you do the same thing we were teaching you in your last post? Instead of displaying a table of calculations, you can have it display any other kind of markup you want. Link to comment Share on other sites More sharing options...
alexnofue Posted November 11, 2010 Share Posted November 11, 2010 have you checked mail() php function?, this needs a mail server in your hosting.or you could use a smtp library for sending the mail. Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 can you do the same thing we were teaching you in your last post? Instead of displaying a table of calculations, you can have it display any other kind of markup you want.I could but all i have is the form with e-mail address, e-mentor e-mail and Name fields with a submit and clear button I know in the e-mail body i want to put in all the totals from the original form not sure how to start not even at debugging here? Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 you could start by reading up on PHP's mail functionhttp://us3.php.net/manual/en/function.mail.phphttp://www.w3schools.com/php/php_mail.aspwhat about looking at the current email code from the page we were working on as a guideline? Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 you could start by reading up on PHP's mail functionhttp://us3.php.net/manual/en/function.mail.phphttp://www.w3schools.com/php/php_mail.aspwhat about looking at the current email code from the page we were working on as a guideline?I tried that and the e-mail does not send and the page does not go to a thank you page it stays where it is. and there is errors to many I figure if there was a simple way to have data from a form be e-mailed to someone and then after you hit the submit on the form the page displays a thank you message. Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 how are you trying to send the mail? live or locally? It won't send an email unless there is an SMTP server installed on your local machine. I don't see how the approach to your last situation is any different than this, other than you just need the page to look differently. In both cases you are passing over information from one page to another page using a form, and using $_POST to get the data. I think we established that workflow in the other thread. Now instead of printing out the table of calculations, you want it print out a thank you message and send an email. You can start on either task first. It would probably be easier to get the thank you text out, and then add in the email functionality. Naturally there are validation issues to take care of on both ends (client/server) and if you still have errors in your code, then you would want to address them first. Get the form passing functionality completed error free, then add in the text you want to be displayed, and then add in the email functionality. Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 how are you trying to send the mail? live or locally? It won't send an email unless there is an SMTP server installed on your local machine. I don't see how the approach to your last situation is any different than this, other than you just need the page to look differently. In both cases you are passing over information from one page to another page using a form, and using $_POST to get the data. I think we established that workflow in the other thread. Now instead of printing out the table of calculations, you want it print out a thank you message and send an email. You can start on either task first. It would probably be easier to get the thank you text out, and then add in the email functionality. Naturally there are validation issues to take care of on both ends (client/server) and if you still have errors in your code, then you would want to address them first. Get the form passing functionality completed error free, then add in the text you want to be displayed, and then add in the email functionality.I am working on the original step by step so far get errors so correcting them one by one then ifit doesn't work i will post again. Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 In this section I get this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/www/users/buzgate/8.0/inc2/five/five4i.html on line 227how do i get each of these to be on a separate line in my e-mail or can i put a table here and it will work.// DEFINE VARIABLES FOR MAILING TO USER AND BUZGATE $to = 'askbuz@buzgate.org,'.$_POST['email']; $email_subject = "Step ".$stepNumber." in Buzgate's Five Step Program"; $eBody = "Total Sales Revenue: ".$_POST['revenue']."\n"; "Variable Cost:".$_POST['cost']. "\n" "Gross Profit: ".$grossProfit. "\n" "Overhead Cost: ".$_POST['overhead']. "\n" "Net Profit: ".$netProfit. "\n"; "Taxes: ".$_POST['taxes']. "\n"; "Other Income: ".$_POST['other']. "\n" ; "Net Income: ".$totalIncome. "\n"; Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 In this section I get this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/www/users/buzgate/8.0/inc2/five/five4i.html on line 227how do i get each of these to be on a separate line in my e-mail or can i put a table here and it will work.// DEFINE VARIABLES FOR MAILING TO USER AND BUZGATE $to = 'askbuz@buzgate.org,'.$_POST['email']; $email_subject = "Step ".$stepNumber." in Buzgate's Five Step Program"; $eBody = "Total Sales Revenue: ".$_POST['revenue']."\n"; "Variable Cost:".$_POST['cost']. "\n" "Gross Profit: ".$grossProfit. "\n" "Overhead Cost: ".$_POST['overhead']. "\n" "Net Profit: ".$netProfit. "\n"; "Taxes: ".$_POST['taxes']. "\n"; "Other Income: ".$_POST['other']. "\n" ; "Net Income: ".$totalIncome. "\n";you shouldn't be putting a semi-colon after the line breaks unless its the last one. Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 now i get this Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/www/users/buzgate/8.0/inc2/five/five4i.html on line 226$eBody = "Total Sales Revenue:".$_POST['revenue']. "\n" "Variable Cost:".$_POST['cost']. "\n" "Gross Profit: ".$grossProfit. "\n" "Overhead Cost: ".$_POST['overhead']. "\n" "Net Profit: ".$netProfit. "\n" "Taxes: ".$_POST['taxes']. "\n" "Other Income: ".$_POST['other']. "\n" "Net Income: ".$totalIncome. "\n"; Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 try this: $eBody = "Total Sales Revenue:".$_POST['revenue']. "\n";$eBody .= "Variable Cost:".$_POST['cost']. "\n";$eBody .= "Gross Profit: ".$grossProfit. "\n";$eBody .= "Overhead Cost: ".$_POST['overhead']. "\n";$eBody .= "Net Profit: ".$netProfit. "\n";$eBody .= "Taxes: ".$_POST['taxes']. "\n";$eBody .= "Other Income: ".$_POST['other']. "\n";$eBody .= "Net Income: ".$totalIncome. "\n";echo 'email body: ' . $eBody; what .= is doing is concatenating the (in this case) string to the right of the equality sign to whatever the present value of $eBody is at that time, essentially building up the string. Link to comment Share on other sites More sharing options...
JimKI Posted November 11, 2010 Author Share Posted November 11, 2010 try this:$eBody = "Total Sales Revenue:".$_POST['revenue']. "\n"; $eBody .= "Variable Cost:".$_POST['cost']. "\n"; $eBody .= "Gross Profit: ".$grossProfit. "\n"; $eBody .= "Overhead Cost: ".$_POST['overhead']. "\n"; $eBody .= "Net Profit: ".$netProfit. "\n"; $eBody .= "Taxes: ".$_POST['taxes']. "\n"; $eBody .= "Other Income: ".$_POST['other']. "\n"; $eBody .= "Net Income: ".$totalIncome. "\n"; echo 'email body: ' . $eBody; what .= is doing is concatenating the (in this case) string to the right of the equality sign to whatever the present value of $eBody is at that time, essentially building up the string. Thanks again it worked Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.