What is the best way to store variables (that don't store any important data) in a file then access and modify them easily from any php script?
I was thinking of a file with a list of variables like this:
$var1='1';
$var2='2';
$var3='3';
..
..
$var7='7';
What if I had a program that only needs 2 variables, and with the need to change them right after using them?
storing variables
Moderator: General Moderators
-
jaymoore_299
- Forum Contributor
- Posts: 128
- Joined: Wed May 11, 2005 6:40 pm
- Contact:
Don't store them in a flat file - too much overhead, security issues etc, use a database or a session like ~timvw suggested.
What are you going to use these variables for? Are they going to be:
What are you going to use these variables for? Are they going to be:
- valid and unique for a single users visit or,
- 1 set of variables for all users or,
- variables that apply to a user over multiple visits?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
jaymoore_299
- Forum Contributor
- Posts: 128
- Joined: Wed May 11, 2005 6:40 pm
- Contact: