Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member beachkitty85's Avatar
    Join Date
    Feb 2007
    Location
    Apex, NC
    Posts
    131
    Member #
    14894
    I have a web application I've written (go me!) and my configuration values are located in a file named config.php. In other apps, I've seen the configuration values put in the database, so I'm thinking of doing that myself. Which do you think is better?
    Christina Van Dyke

    CRV Designs
    Apex, NC
    www.crv-designs.com

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    It's common to use a config.php file.

    Just make sure it's in a safe place, like a protected directory.

    The reason some config values are placed in a database is because
    they are things that can be changed by a user (an administrator) via
    an admin page.

    The config.php file itself is usually something that is hard-coded,
    never changes, and is used for the setup and installation of a script.
    In some cases, once a set-up is run, that file gets deleted.


  4. #3
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Indeed, you've got to put your database configuration somewhere so you'll need a config.php or similar regardless... where you then put other configuration parameters, in that file or the database, is really up to you.

    I'd go with what our friend says above... if something is never going to change put it in the text file (eg. database config, path to site), if it might change (eg. meta tags values, site title) put it in the database.

    Sean

  5. #4
    Senior Member beachkitty85's Avatar
    Join Date
    Feb 2007
    Location
    Apex, NC
    Posts
    131
    Member #
    14894
    Ok, thanks for all the help. I'm going to move all the config values (except the db ones of course!) to the db. This way I can write a script that lets me update these values without having to open the config file.
    Christina Van Dyke

    CRV Designs
    Apex, NC
    www.crv-designs.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:29 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com