<style>
.cookies{
background:blue;
bottom:0;
position:fixed;
height:20px;
width:100%;
}
a{
color:white;
font-size:20px;
border:1px solid red;
}
</style>
<pre>
<?php
session_start();
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url=parse_url("{$actual_link}");
if(!isset($url['query'])){
if(!file_exists('session.txt')){
null;
}else{
$_SESSION['close']=file_get_contents('session.txt');
}
}else{
if($url['query']=='pobranie'){
$_SESSION['close']='none';
file_put_contents('session.txt','none');
}else{
null;
}
}
// $_SESSION=[];
// session_destroy();
?>
<div class="cookies" style="display:<?= $_SESSION['close'] ?>;"><a href="<?= $actual_link.'?pobranie';?>" style="float:right">X</a></div>
Lub:
//(...)
if($url['query']=='pobranie'){
setcookie('remove_message_about_cookies','none',time()+3600);
header("Location: {$url['scheme']}://{$url['host']}{$url['path']}");
}else{
null;
}
//(..)
<div class="cookies" style="display:<?= $_COOKIE['remove_message_about_cookies'] ?>;"><a href="<?= $actual_link.'?pobranie';?>" style="float:right">X</a></div>