Results 1 to 9 of 9

Thread: What's the equivalent of ASPs' Application object?

  1. #1

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433

    What's the equivalent of ASPs' Application object?

    see subject line.

    TIA.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    If I knew what the Application Object was, perhaps I could help you?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    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.

  4. #4

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    ...a globally accessable associative array.

  5. #5
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    it called putting them into a file and using them.

    $bgColor = "#COCOCO"


    echo"<td bgcoor=".$bgColor.">somedata here </td>";

    just like that.

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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'];
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    Thanks Guys!

  8. #8

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    ...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.

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width