note 106924 added to features.sessions
| From: | Johnny at osu1 dot php dot net | Date: | Mon, 19 Dec 2011 09:24:56 +0000 |
| Subject: | note 106924 added to features.sessions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185132@lists.php.net to get a copy of this message | ||
Here is a the basic structure of the SESSIONs in PHP:
Start a session and initialize it:
<?php
session_start();
$_SESSION['visitors']=1;
?>
<html>
<body>
<?php
echo "Nr of visitors=". $_SESSION['visitors'];
?>
</body>
</html>
to free a specified session variable use:
<?php
unset($_SESSION['visitors']);
?>
and this one if you want to destroy it for good:
<?php session_destroy(); ?>
hope it helps!!
----
Server IP: 193.231.122.254
Probable Submitter: 193.231.19.18
----
Manual Page -- http://www.php.net/manual/en/features.sessions.php
Edit -- https://master.php.net/note/edit/106924
Del: integrated -- https://master.php.net/note/delete/106924/integrated
Del: useless -- https://master.php.net/note/delete/106924/useless
Del: bad code -- https://master.php.net/note/delete/106924/bad+code
Del: spam -- https://master.php.net/note/delete/106924/spam
Del: non-english -- https://master.php.net/note/delete/106924/non-english
Del: in docs -- https://master.php.net/note/delete/106924/in+docs
Del: other reasons-- https://master.php.net/note/delete/106924
Reject -- https://master.php.net/note/reject/106924
Search -- https://master.php.net/manage/user-notes.php