Skip navigation
Currently Being Moderated

There is a syntax error on line 25. Code hinting may not work until you fix this error.

Jul 19, 2012 7:52 AM

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!

    $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 />';       

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points