Get all variables and store them in a global file for NEWBIE

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
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Get all variables and store them in a global file for NEWBIE

Post by ianhull »

Can any one of you guys help me with getting all the variables from one page and storing them in a global file

The global file is used as a include file on all my pages.

I am new to php and do not know much about it so any help will be greatly appreciated.

Thanks in advance
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

I'm not sure if you can just get all declared variables - you need to reference each one in particular.

Further, I would strongly recommend using a cookie or a session to store any variables you need, rather than storing them in a file. Handling cookies and sessions will also have quite a bit less overhead.

You can store stuff in a cookie simply by calling setcookie().
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply