-3

我得到一个我已经关闭Parse error: syntax error, unexpected T_IF的。我找不到为什么声明有问题if (mail($to, $subject, $body, $header))semi-colonsIf

 <?php
    include('dbconnect.php');

    if (isset($_POST['submit']))
    {

        ...

        $to = 'sent@sent.com';
        $subject = $_POST['Subject'];
        $header = 'From:' .$_POST['Email'];
        $message = 
        'New fedback sent by  
        First Name: '.$_POST['FirstName'].' 
        Last Name: '.$_POST['LastName'].'
        about '.$_POST['Subject'].' 
        Message: '.$_POST['msg'].' 
        '

        if (mail($to, $subject, $body, $header))
        {

    }   
?>
4

2 回答 2

2

你需要结束你的$message任务,例如;

 $message = 
    'New fedback sent by  
    First Name: '.$_POST['FirstName'].' 
    Last Name: '.$_POST['LastName'].'
    about '.$_POST['Subject'].' 
    Message: '.$_POST['msg'].' 
    ';
于 2013-07-02T02:40:12.087 回答
1

这:

    $message = 
    'New fedback sent by  
    First Name: '.$_POST['FirstName'].' 
    Last Name: '.$_POST['LastName'].'
    about '.$_POST['Subject'].' 
    Message: '.$_POST['msg'].' 
    '

缺少结束分号;。你需要关闭它:

    $message = 
    'New fedback sent by  
    First Name: '.$_POST['FirstName'].' 
    Last Name: '.$_POST['LastName'].'
    about '.$_POST['Subject'].' 
    Message: '.$_POST['msg'];
于 2013-07-02T02:40:03.290 回答