龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

PHP 通过 Cookie 记录用户的访问时间

时间:2014-07-22 14:52来源: 作者: 点击:
分享到:
<无详细内容>
<?php
 setcookie( "vegetable", "artichoke", time()+3600, "/",".oschina.net", 0 );
 ?>
 <html>
 <head>
 <title>Setting and Printing a Cookie Value</title>
 </head>
 <body>
 <?php
 if ( isset( $_COOKIE['vegetable'] ) ) {
     print "<p>Hello again, your chosen vegetable is ";
     print "{$_COOKIE['vegetable']}</p>";
 } else {
     print "<p>Hello you. This may be your first visit</p>";
 }
 ?>
 </body>
 </html>
精彩图集

赞助商链接