Jump to content

[SOLVED] Code is displaying values instead of sending them to the email address


Modernvox

Recommended Posts

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

 

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>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.