Last active
March 10, 2017 20:56
-
-
Save nikolaykrylov/bda6898740014c66c0516f37767372ab to your computer and use it in GitHub Desktop.
Counts how many times user visited site (using cookies)
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 | |
$count = 1; | |
if (isset($_COOKIE['counter'])){ | |
$count = intval($_COOKIE['counter']); | |
$count ++; | |
} | |
setcookie('counter', $count); | |
echo "Вы посетили сайт $count раз"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment