Skip to content

Instantly share code, notes, and snippets.

@j0K3Afr4id
Last active December 21, 2017 07:46
Show Gist options
  • Save j0K3Afr4id/3e6a8a0a32691848527bf1188b95d401 to your computer and use it in GitHub Desktop.
Save j0K3Afr4id/3e6a8a0a32691848527bf1188b95d401 to your computer and use it in GitHub Desktop.
Contatore Amin
<?php
if(isset($_POST)){
if(isset($_COOKIE["Amin_Count"])){
$contatore = $_COOKIE["Amin_Count"] + 1;
setcookie("Amin_Count", $contatore, time() + (60 * 60 * 24 * 7));
}
else{
$contatore = 1;
setcookie("Amin_Count", $contatore, time() + (60 * 60 * 24 * 7));
}
}
?>
<html>
<head>
</head>
<body>
<p>Ciao</p>
<br>
<?php
if ($contatore==1)
echo "Sei entrato per la prima volta";
else
echo "Sei entrato" . $contatore . "volte in questa pagina";
?>
<form action="contatore.php" method="post">
<input type="submit" name="submit" value="ricarica"/>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment