问题
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