-1
votes

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
(empty( ($email) looks incorrect and (empty($message as well. You are also missing a } at the end.Felix Kling

1 Answers

0
votes

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>