I have an <a href="cookieaccept.php?accept=yes">
that links to a php file with this code:
<?php
function goback()
{
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
}
$option = @$_GET['accept'];
if(!empty($option)) // If user enter with some value
{
if($option== "yes")
{
setcookie("cookieaccept", "yes", time()+2592000, "/");
goback();
} else if($option=="no") {
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
} else {
echo "Error... !"; //If it comes with value other than yes or no
}
} else {
echo "Error... !"; // If it comes with no value at all
}
?>
After clicking on the accept button i want the current page to refresh. But because the action takes place in a separate php file i can't get this to work... I tried with history back, refresh but i need some help with this one please.
Regards, Robert