Globally accessing variable in php

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
deepakagrawal1982
Forum Newbie
Posts: 2
Joined: Thu Apr 12, 2007 4:24 am

Globally accessing variable in php

Post by deepakagrawal1982 »

Hello,
I am deepak, i am desiging a website on php, so on can i make a variable in such a way so thai i can access that variable on other file, such as when we declare a extern variable in 'c' and we can access on other file ....
So pls tell me can i do same as on "php".
Thanks
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You'll probably want to use sessions or cookies.
User avatar
bpopp
Forum Newbie
Posts: 15
Joined: Mon Apr 09, 2007 11:18 pm
Location: Memphis

Post by bpopp »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You could also use a database, though I think sessions would better.
Post Reply