Copy link to clipboard
Copied
Hello everyone. New to the forums and been enjoying Dreamweaver CS5's powerful capabilities up until this point. I'm a little new to PHP, and having a little trouble. I will link the PHP syntax for you guys to take a look at. What I'm trying to make is a PHP file that sends an email for a refer a friend type form. This is line 16-34. Lines 25 and 29 are highlighted red. I'm a bit confused as to the errors given here, so any help would be greatly appreciated. I understand there's no email address in the $to string, I took it out for privacy's sake. Thanks in advance!
<?php
$yourname = $_POST('yourname');
$youremail = $_POST('youremail');
$friendsname = $_POST('friendsname');
$friendsemail = $_POST('friendsemail');
$other = $_POST('other');
$to = '';
$subject = 'Refer a Friend from Whimsical Practicality'
$msg = "$yourname recommended Whimsical Practicality to $friendsname.\n" .
"Customer's email address: $youremail\n" .
"Friend's email address: $friendsemail\n" .
"Customer used this description: $other"
mail($to, $subject, $msg, 'From:' . $yourname);
echo 'Thanks for recommending us!<br />';
echo 'Your recommendation has been sent.<br />';
echo 'Please use the Back button to return to the previous page.<br />';
?>
Copy link to clipboard
Copied
The $subject line is missing a semi-colon at the end and so is the $msg line.
Copy link to clipboard
Copied
Is there any way, in general, to know what is error in that line of PHP (similar to those I see in Zend/Eclise/equivalent) ?
I am working on Dw CS6 and got several red lines but cannot figure out what is the error exactly.
Copy link to clipboard
Copied
Square brackets. See example below:
$yourname = $_POST['yourname'];
Copy link to clipboard
Copied
Try PHP Code Checker.
Nancy O.