doy51723 2010-12-24 00:34
浏览 48

PHP表单脚本错误

I have created a rather larger html form and I would like the data to send to my email address.

I am using the POST method and thought my PHP was up to snuff. However, I now get the following error upon submission:

Parse error: syntax error, unexpected '}' in C:\www\mo\marinecforum\send_form_application.php on line 90. 

I am having a hell of a time with this. Beyond the error above, I wonder if there is a better way to approach this?

Here is the PHP code.

  • 写回答

3条回答 默认 最新

  • douluokuang7184 2010-12-24 00:39
    关注

    Syntax error:

    This

    }    mail($to, $email_subject, $message, $headers); ?>
    

    to this...

    mail($to, $email_subject, $message, $headers);
    

    Also when you write "$content =" you are resetting variable, you should append by "$content .="

    Edit:

    Here is entire code, that will probably work... http://sorskod.com/6ERZ455T

    EDIT2:

    Rename

    Email Address <input type="text" name="address" />
    

    To

    Email Address <input type="text" name="email" />
    

    OR change $_POST["email"] to $_POST["address"] in PHP file.

    EDIT3:

    Configure mail.

    ini_set("SMTP","mail.marineconomicforum.org");
    ini_set("smtp_port","25");
    ini_set('sendmail_from', 'alex@marineconomicforum.org');
    
    评论

报告相同问题?