Storing database settings

Sharky Forums


Results 1 to 2 of 2

Thread: Storing database settings

  1. #1
    Catfish webraycer's Avatar
    Join Date
    Dec 2001
    Location
    Midlothian, VA, USA
    Posts
    187

    Storing database settings

    I'm writing this web application in php, and it involves filling out an html form which will set up the system. The form gets info like sql username, password, hostname, database name, etc. There's other settings too. I had this idea that it would be easy to store the data in a database table. That way I wouldn't have to write it to a file or anything. However, I can't connect to the database to get the info without having the info from the database.

    Question 1: Does anyone have any suggestions, or should I just write the data to a file?

    Question 2: How do I allow PHP to create a file without having write permissions set for everyone (I'm in linux and this means making the folder chmod'ed to 777, which is far from desirable)

  2. #2
    . ksuohio's Avatar
    Join Date
    Oct 2001
    Location
    Atlanta, GA
    Posts
    2,721
    I would just use a cookie to store the machine and database name at least. Each time the user tries to login, you can retrieve those items from the cookie and they could provide their username and password.

    Computers don't have faith and that would be required for it to believe that another system is out their to connect to without having the properties
    Last edited by ksuohio; 03-01-2005 at 05:26 PM.
    ---------------------------------------------------------------
    - Asus M50 Laptop - C2D T9300 - 4 gig RAM - Radeon HD 3650 - Vista x64 Ultimate

    - Intel i7-3770K - Asus P8Z77-V DELUXE - 32gig RAM - Radeon HD7970 Ghz - Plextor M3 256GB/120GB OCZ Vertex3
    - LG BluRay - Razor Blackwidow Ultimate Keyboard - Logitech G9x
    - HP ZR2740w/Asus LCD - W7 Ultimate

    ---------------------------------------------------------------

Posting Permissions

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