Skip to main content
Participant
July 19, 2012
Question

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

  • July 19, 2012
  • 1 reply
  • 2518 views

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

?>      

This topic has been closed for replies.

1 reply

Community Expert
July 19, 2012

The $subject line is missing a semi-colon at the end and so is the $msg line.

Participant
November 6, 2012

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.

Rob Hecker2
Legend
November 6, 2012

Square brackets. See example below:

$yourname = $_POST['yourname'];