I have an ad and I want to know if the person has already clicked on the ad in the last 2 days.
If it has already clicked, it does not appear, but if it did not click, it still appears.
Something like this:
<!DOCTYPE html>
<?php
setcookie("USER","sim", time() + 172800); // 86400 = 1 dia, 172800 = 2 dia
?>
<html>
<body>
<?php if (!isset($_COOKIE["USER"])): ?>
<div class="anuncio">
ANUNCIO PARA QUEM NÃO CLICOU AINDA!
</div>
<?php else: ?>
<div class="">
OPS, VC JA CLICOU NÃO APARECER ANUNCIO
</div>
<?php endif; ?>
</body>
</html>
But how do you know if he already clicked within this <div>
, that is, if he already clicked on the ad