Ad block is installed and active. Please support us by disabling it.
HomeSaturday, January 20, 2018, 16:52:11
1

PHP $_SESSION

Monday, February 9, 15, 13:32:12, 3 Yaers Ago Via wain, Hits: 3300
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

php Array

These functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.

MySQL Tutorials

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

Convert pdf to image - mpdf

Convert pdf file to jpg with php and mpdf

How to set up password for phpMyAdmin in Wamp Server

Password for phpMyAdmin in Wamp

PHP filesize

The filesize function returns the size of the specified file.

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.

PHP Tutorials

Useful step-by-step PHP tutorials for beginners

PHP $_GET Function

Get function in PHP

PHP Form Validation

PHP form validation :: PHP tutorial, requirement(s): PHP Server

Captcha V1 - Free PHP Script

An anti-spam form protection image written in PHP, Version: 1.1.
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.