File: cookie_based_counter.php

package info (click to toggle)
postfixadmin 2.3.5-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,200 kB
  • sloc: php: 25,767; xml: 14,485; perl: 964; sh: 664; python: 169; makefile: 84
file content (10 lines) | stat: -rw-r--r-- 251 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
<?php
    $count = 1;
    if (isset($_COOKIE['count'])) {
        $count = $_COOKIE['count'] + 1;
    }
    setcookie('count', $count);
?><html>
    <head><title>Cookie Counter</title></head>
    <body><?php print 'Count: ' . $count; ?></body>
</html>