Session Variables

Session variables allow you to create variables that maintain their value across multiple pages. This allows you to create a user login and shopping carts. You must start a session before any output is created. That means that the very first thing on the page is
<?php
  session_start();

If there is even one space before the <?php then you will get an error message that the headers have already been sent.

Example

Click this link first.

Look at the source of the first page saved as txt.

Look at the source of the second page saved as txt.

Session variables


INDEX, Introduction
Next lesson: Introduction to MySQLMAIN INDEX
EXAMPLES INDEX

Copyright © Zebra0.com
All rights reserved worldwide.

 
 

Introduction