Last active
December 21, 2017 07:46
-
-
Save j0K3Afr4id/3e6a8a0a32691848527bf1188b95d401 to your computer and use it in GitHub Desktop.
Contatore Amin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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