Modernvox Posted November 17, 2009 Share Posted November 17, 2009 Won't send to address <html> <body> <?php if(isset($_POST['submit'])) $dimen1 = $_POST['room1']; $dimen2 = $_POST['room2']; $dimen3 = $_POST['room3']; $dimen4 = $_POST['room4']; $dimen5 = $_POST['room5']; $email = $_POST['email'];' $sum= $dimen1 + $dimen2 + $dimen3 + $dimen4 + $dimen5; printf("$%01.2f", $sum); echo "Your estimate is \$$sum; $to = '[email protected]'; $subject = 'You have an estimate request'; $msg = 'Estimate Total': \$$sum\n" . mail($to, $subject, $msg, 'From:' . $email); ?> </body> </html> Error: Parse error: syntax error, unexpected T_STRING in /home/a7250761/public_html/getquote.php on line 62 Link to comment https://forums.phpfreaks.com/topic/181908-solved-code-is-displaying-values-instead-of-sending-them-to-the-email-address/ Share on other sites More sharing options...
geudrik Posted November 17, 2009 Share Posted November 17, 2009 you have an open ' after your last $email = $_POST edit: have your $msg var in double quotes, as if you put $msg = 'Estimated Total:' . .. Wait, lot's of quotational mistakes... Try this.. <html> <body> <?php if(isset($_POST['submit'])) $dimen1 = $_POST['room1']; $dimen2 = $_POST['room2']; $dimen3 = $_POST['room3']; $dimen4 = $_POST['room4']; $dimen5 = $_POST['room5']; $email = $_POST['email']; $sum= $dimen1 + $dimen2 + $dimen3 + $dimen4 + $dimen5; // printf("$%01.2f", $sum); echo "Your estimate is: $ $sum"; $to = '[email protected]'; $subject = 'You have an estimate request'; // Look at your quotes... Where do open and close? // Doesnt work => $msg = 'Estimate Total': \$$sum\n" . $msg = "Estimate Total: $ $sum"; mail($to, $subject, $msg, 'From:' . $email); ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/181908-solved-code-is-displaying-values-instead-of-sending-them-to-the-email-address/#findComment-959434 Share on other sites More sharing options...
Modernvox Posted November 17, 2009 Author Share Posted November 17, 2009 you have an open ' after your last $email = $_POST edit: have your $msg var in double quotes, as if you put $msg = 'Estimated Total:' . .. Wait, lot's of quotational mistakes... Try this.. <html> <body> <?php if(isset($_POST['submit'])) $dimen1 = $_POST['room1']; $dimen2 = $_POST['room2']; $dimen3 = $_POST['room3']; $dimen4 = $_POST['room4']; $dimen5 = $_POST['room5']; $email = $_POST['email']; $sum= $dimen1 + $dimen2 + $dimen3 + $dimen4 + $dimen5; // printf("$%01.2f", $sum); echo "Your estimate is: $ $sum"; $to = '[email protected]'; $subject = 'You have an estimate request'; // Look at your quotes... Where do open and close? // Doesnt work => $msg = 'Estimate Total': \$$sum\n" . $msg = "Estimate Total: $ $sum"; mail($to, $subject, $msg, 'From:' . $email); ?> </body> </html> Excellent review and repair. Thank you. Link to comment https://forums.phpfreaks.com/topic/181908-solved-code-is-displaying-values-instead-of-sending-them-to-the-email-address/#findComment-959442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.