downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

处理 XForms> <Cookie
[edit] Last updated: Fri, 25 May 2012

view this page in

会话

会话机制(Session)在 PHP 中用于保存并发访问中的一些数据。这使可以帮助创建更为人性化的程序,增加站点的吸引力。关于会话机制的更多信息,请参见会话处理函数一章。



add a note add a note User Contributed Notes 会话
idandaniels at gmail dot com 05-Mar-2012 07:00
How to start a session and track it by Pageviews, in this example, if there arent any pageviews, we will get 1.

<?php
session_start
();

if(isset(
$_SESSION['views']))
{
$_SESSION['views']=$_SESSION['views']+1;
}
else
{
$_SESSION['views']=1;
echo
"Views=". $_SESSION['views'];
}
?>

 
show source | credits | sitemap | contact | advertising | mirror sites