Zen Follower
- Join Date:
- Apr 2012
- Posts:
- 151
- Plugin Contributions:
- 0
I want to define myself grobal var,where to put it?
for example, I want to create a grobal var $coupon_amount ,this var can be used for any page of systerm.
where to place my var?
Started by linjuming on 7 Jul 2012, 7:41 AM · Views: 430
Zen Follower
for example, I want to create a grobal var $coupon_amount ,this var can be used for any page of systerm.
where to place my var?
Totally Zenned
If you are talking about a php variable then you would create a session variable. You just need to check that that session variable is not used yet and I am not sure about 'coupon_amount' so I would use something more unique than that. You'd do it like this:
$myVariable = $_SESSION['my_variable'];
And you would want to consider unsetting it when you have finished using it.
Nick
iszent.com
Tell staff why this post should be reviewed.