phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Session Variable: Introduction

Tag: session, variable   Category: PHP Basic
post: 08 Mar 2008 read: 273


Session Variable Step By Step Tutorial - Part 1: Variable session is a global variable that is to be made at the time of the session started. To start the session, you can do it by using session_start() function explicitly or using session_register() function implicitly. For further information, you can see the example beneath:

Create first page like this (file named ses01.php)


<?
//the example of variable session
//ses01.php

session_start();
$test_session = "This is a variable session";
session_register("test_session");
echo ("<a href=ses02.php>Next>>></a>");
?>

Then, create a file named ses01.php:


<?
//the example of variable session
//ses02.php

session_start();
print "\$test_session = $test_session";
?>

Run the ses01.php program, click 'Next>>>' then this program goes to ses02.php and the result is:

session variable test


Series this article:
Session Variable: Introduction
Session Variable: Session Application
Session Variable: Simple Login Checking

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting