IT Community - Software Programming, Web Development and Technical Support

PHP Tips and Tricks

This is a discussion on PHP Tips and Tricks within the PHP Programming forums, part of the Web Development category; Sessions Starting a Session To start a session use session_start() and to register a variable in this session use the $...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #21 (permalink)  
Old 12-18-2007, 06:26 AM
Sabari Sabari is offline
D-Web Genius
 
Join Date: Jul 2007
Posts: 1,008
Sabari is on a distinguished road
Default Re: PHP Tips and Tricks

Sessions

Starting a Session
To start a session use session_start() and to register a variable in this session use the $_SESSION
array.


<?php
session_start();
$_SESSION['my_var'] = 'Hello World';
?>
If register_globals is enabled then your session variables will be available as normal variables on
subsequent pages. Otherwise they will only be in the $_SESSION array.


<?php
session_start();
echo $_SESSION['my_var'];
?>
__________________
Thanks & Regards
Sabari...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 84 12-02-2008 02:12 AM
SAP Tips & Tricks leoraja8 Operating Systems 0 03-29-2008 01:11 AM
BlueTooth tips and tricks devarajan.v Mobile Software Development 52 03-13-2008 10:46 PM
.NET tricks & Tips Karpagarajan VB.NET Programming 1 04-23-2007 09:17 AM
SEO Tips & Tricks spid4r Search Engine Optimization 0 03-09-2007 12:03 AM


All times are GMT -7. The time now is 06:01 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0