personal-site/contact-form/functions.php
2021-06-20 08:02:27 +01:00

20 lines
373 B
PHP

<?php
function redirectWithError($error)
{
$_SESSION['_contact_form_error'] = $error;
header('Location: '.$_SERVER['HTTP_REFERER']);
echo "Error: ".$error;
die();
}
function redirectSuccess()
{
$_SESSION['_contact_form_success'] = true;
header('Location: '.$_SERVER['HTTP_REFERER']);
echo "Your message was sent successfully!";
die();
}