|
-
Oct 27th, 2002, 03:20 AM
#1
Thread Starter
Hyperactive Member
What's the equivalent of ASPs' Application object?
-
Oct 27th, 2002, 11:14 AM
#2
Stuck in the 80s
If I knew what the Application Object was, perhaps I could help you?
-
Oct 27th, 2002, 11:41 AM
#3
Thread Starter
Hyperactive Member
It's used to store variables and objects etc. that can be accessed via any page anytime.
I need something that I can use to store 'settings' for an application in.
Eg:
Database = "DB1"
bgColor = "#COCOCO"
Font = "Verdana, Arial"
...and then access it in any page without having to set the values again.
This confusing?
Similar to autoglobals??
TIA.
-
Oct 27th, 2002, 11:43 AM
#4
Thread Starter
Hyperactive Member
...a globally accessable associative array.
-
Oct 29th, 2002, 10:37 AM
#5
Frenzied Member
it called putting them into a file and using them.
$bgColor = "#COCOCO"
echo"<td bgcoor=".$bgColor.">somedata here </td>";
just like that.
-
Oct 29th, 2002, 11:30 AM
#6
Stuck in the 80s
I just make a file, like config.php, and have that file set up an array like:
Code:
$CONFIG['bgColor'] = 'blah';
$CONFIG['database'] = 'db1';
and then call it on each page:
Code:
include 'config.php';
echo $CONFIG['bgColor'];
-
Oct 29th, 2002, 12:10 PM
#7
Thread Starter
Hyperactive Member
Thanks Guys!
-
Nov 16th, 2002, 02:27 PM
#8
Thread Starter
Hyperactive Member
...But, doesn't it take up a lot of memory having to load the whole page of variables on every page?
Also, is there an easy way to modify those variables via code?
Kind Regards, Dodger.
-
Nov 17th, 2002, 12:03 AM
#9
Stuck in the 80s
No, it doesn't take up much memory, unless you have a 1.3tb file (old joke, ignore it).
There would be no way to change it permenantly. You could always change it for the time being, but you'd have to either 1) write over the file with the new values, which would mean you'd have to chmod a few things. or 2) store them in a mysql database and update it as needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|