• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Jul 19, 2012 Jul 19, 2012

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

?>      

TOPICS
Server side applications

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2012 Jul 19, 2012

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2012 Nov 06, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Nov 06, 2012 Nov 06, 2012

Copy link to clipboard

Copied

Square brackets. See example below:

$yourname = $_POST['yourname'];

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2012 Nov 06, 2012

Copy link to clipboard

Copied

LATEST

Try PHP Code Checker.

http://phpcodechecker.com/

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines