Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created March 7, 2012 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/1991471 to your computer and use it in GitHub Desktop.
Save hisasann/1991471 to your computer and use it in GitHub Desktop.
クッキーにセットした値をカウントアップします。
<?php
if( isset($_COOKIE['count']) ){
$count = $_COOKIE['count'];
} else {
$count = 0;
}
$count++;
setcookie('count', $count);
?><!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php echo($count); ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment