I think I have had a bug with a contact form which has been working for the last 2 months and now all of a sudden is says:
Fatal error: Cannot redeclare function (previously declared in...)
I have tried turning off the functions one by one but it just gives same error for next function down. My code is pretty standard. but, here it is (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);