嗨,每当我按下提交时,我的代码就会出现错误,该代码会链接到联系表格。当前是“解析错误:语法错误,意外的';'在第12行的/websitename/public_html/GloboGym/assets/includes/signup.inc.php中“”
当我尝试删除此意外的';'时有人可以帮助我吗?甚至除了前三行之外的所有代码都仍然会出错。
<?php
if (isset($_POST['signup-submit'])) {
require 'connect_db.php';
$username = $_POST['uid'];
$email = $_POST['mail'];
$password = $_POST['pass'];
$passwordRepeat = $_POST['pass-repeat'];
if (empty($username) || (empty($email) || (empty($password) || (empty($passwordRepeat)) {
header("Location: ../assets/signup.php?error=emptyfields&uid=".$username."&mail=".$email);
}
}
答案 0 :(得分:-1)
您应该关闭if函数,然后像这样编写空函数:
if (empty($username) || empty($email) || empty($password) || empty($passwordRepeat)) {
//execute if statement
}