我想我在过去 2 个月里一直在使用的联系表单出现错误,现在突然说:
致命错误:无法重新声明函数(之前在...中声明)
我已经尝试一个一个地关闭这些功能,但它只会为下一个功能提供相同的错误。我的代码非常标准。但是,这里是(this is the beginning of the function. The code is long)
//Functions
function e($value)
{
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
//---------die dump function----------
function dd($data)
{
die(var_dump($data));
}
//Booking Page code (beginning)
<?php
require 'includes/config.php';
$name = $email = $date = $phone = $age = $tour = $message = '';
$errors = [];
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = e($_POST['name']);
$email = e($_POST['email']);
$tour = !empty($_POST['tour']) ? $_POST['tour'] : '';
$phone = e($_POST['phone']);
$date = e($_POST['date']);
$age = e($_POST['age']);
$message = e($_POST['message']);
$errors['name'] = checkNameBooking($name);
$errors['email'] = checkEmailBooking($email);
$errors['tour'] = checkTourBooking($tour);
$errors['date'] = checktimeBooking($date);
$errors['age'] = checkAgeBooking($age);