RSS
Home
|
Link Us
|
Contact
Categories
-- All --
Perl
PHP
MySQL
Windows
JavaScript
HTML
Apache
CVS
Linux
SEO
Perl (9)
PHP (35)
MySQL (5)
Windows (7)
JavaScript (5)
HTML (6)
Apache (6)
CVS (4)
Linux (13)
SEO (11)
The registration is temporarily disabled.
However you can post your comments without registration.
Authentication
Username:
Password:
Register
|
Lost password
-->
This tip/code snippet describes a simple php session example
Home
»
PHP
»
This tip/code snippet describes a simple php session example
Date: 2005-06-19
This tip/code snippet describes a simple php session example
Download
|
Printer Friendly
Add to Google
Add to Del.icio.us
Add to Digg
Add to Technorati
Add to Yahoo!
Add to Blinklist
Add to Furl
Add to reddit
<?php // Start the session session_start(); // Init the counter if( !isset( $_SESSION[ 'counter' ] ) ) { $_SESSION[ 'counter' ] = 0; } $_SESSION[ 'counter' ]++; // if the counter exceeds 50 reset it if ( $_SESSION[ 'counter' ] > 50 ) { $_SESSION[ 'counter' ] = 0; } // Output session ID and counter printf("Our session ID is: %s<br>", session_id()); print("The counter value is: " . $_SESSION[ 'counter' ] ); ?>
Comments
No comments yet.
Post a comment
Your Name
Your Email
(won't be published)
Site
(e.g. http://)
*
Title
*
Comment
*
Required fields.
Copyright © 2005-2008
Execution time: 0.05006
hosted by
1and1