TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-08-2008, 01:26 PM   #1 (permalink)
The Wanderer
 
Edwin's Avatar
 
Join Date: Jan 2008
Posts: 10
Thanks: 1
Edwin is on a distinguished road
Default Php sessions?

Where can i find the code for this i been looking around for a while now anyone knows? im sorry if im not suppose to do this here.
Edwin is offline  
Reply With Quote
Old 01-08-2008, 01:38 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

There's no need to apologise ! We have an article on the life of a session, however, if you'd care to elaborate on your question then maybe we could assist you more? From what I gather though you're just looking to set up a basic session?

php Code:
session_start();

$_SESSION['username'] = 'Wildhoney';

Then as long as you're on the same website, with the same session ID, you can access $_SESSION['username'] as long as you place session_start() above it:

php Code:
session_start();

echo $_SESSION['username'];
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-08-2008, 01:40 PM   #3 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Here you go: PHP: Sessions - Manual

The PHP online manual is a great thing to browse when you're lost, it has good categorization of functions and objects.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


All times are GMT. The time now is 04:46 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design