Ad block is installed and active. Please support us by disabling it.
HomeThursday, September 21, 2017, 03:16:54
1

PHP $_SESSION

Monday, February 9, 15, 13:32:12, 3 Yaers Ago Via wain, Hits: 2651
Session_start creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.
Example:

index.php

Code:
<?php session_start();
$numero = rand(100, 999);
$_SESSION['rand'] = $numero;
echo $_SESSION['rand'];
?>
<br><a href="session.php">session.php</a>


session.php

Code:
<?php session_start();
echo $_SESSION['rand'];
?>
<br /><a href="destroy.php">destroy.php</a>


destroy.php

Code:
<?php session_start();
echo $_SESSION['rand'];
session_destroy();
?>
<br /><a href="index.php">index.php</a>

Sign In

Sponsor

Related

MySQL Tutorials

MySQL tutorials, MySQL training, learn MySQL, MySQL Tutorial with practical examples.

Captcha V1 - Free PHP Script

An anti-spam form protection image written in PHP, Version: 1.1.

Upload and Resize an Image with PHP

Tutorial - How to upload and resize image with PHP

PHP Date Examples

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given.

Stack Overflow Clone Script - Ja2BU

Open source question and answer script written in PHP, MySQL and jQuery. Main features are: SEO friendly url's, private message system, rating system, comments system.

PHP $_POST Function

Collect values from a form sent with method post

Contact Us PHP Form 1.1.

A contact us form with email and form field validation. It allows your visitors to send you an email directly from your website.

Adsense crawler errors and robots.txt

How to fix Google AdSense crawler errors in robots.txt

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

PHPBB3 Shoutbox

Vesion: 1.1. Released: 08/08/10, Licence GNU, Price: Free
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.