我想我有一个错误的联系表格已经工作了2个月,现在突然间说:
致命错误:无法重新声明功能(之前在...中声明)
我已经尝试逐个关闭这些功能,但它只是为下一个功能提供相同的错误。我的代码很标准。但是,这里是(this is the beginning of the function. The code is long)
//功能
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);