Parse error: syntax error, unexpected '(' in D:\xampp3\xampp\htdocs\contact.php on line 10 [closed]

淺唱寂寞╮ 提交于 2019-12-25 18:17:33

问题


I have a problem with my code here. I'm making a simple "Contact us" via html / PHP. But i'm new to all this, and learning it from step to step. So thats why i've come here. I get this error: Parse error: syntax error, unexpected '(' in D:\xampp3\xampp\htdocs\contact.php on line 10 and here is the code:

<i><?php
include 'core/init.php';
include 'includes/overall/header.php';
if (empty($_POST) === false) {

    $name     = $_POST ['name'];
    $email    = $_POST ['email'];
    $message  = $_POST ['message'];

    if (empty($name) === true || (empty( ($email) === true || (empty($message === true)  {
       $errors[] = 'Name, email and message are required!';
    } else {

}  
?></i>

回答1:


Try this:

<i><?php
include 'core/init.php';
include 'includes/overall/header.php';
if (empty($_POST) === false) {

    $name     = $_POST ['name'];
    $email    = $_POST ['email'];
    $message  = $_POST ['message'];

    if (empty($name) === true || empty($email) === true || empty($message) === true)  {
       $errors[] = 'Name, email and message are required!';
    } else {
    }
    // The else above is actually not needed thus you could remove it.

}  
?></i>


来源:https://stackoverflow.com/questions/17260232/parse-error-syntax-error-unexpected-in-d-xampp3-xampp-htdocs-contact-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!