Session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Session

Post by moiseszaragoza »

Hi Everyone. I was wandering if anyone knew hot to save a variable in a session?

Thanks for all of your help
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

session_start() does what it says on the tin. You must call session_start() before any browser output.

Next, just declare session keys and values:

Code: Select all

$_SESSION['foo'] = 'bar';
Post Reply