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 = 'myemail@aol.com';
$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
Share on other sites

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 = 'myemail@aol.com';
$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
Share on other sites

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 = 'myemail@aol.com';
$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.