+ Post New Thread
Results 1 to 2 of 2
Web Development Thread, PHP settings file - web based editing? in Coding and Web Development; For our intranet, I have a php settings file (which I have appropriately named config.inc.php) and values from here are ...
  1. #1
    dgsmith's Avatar
    Join Date
    Nov 2007
    Location
    Merseyside, England
    Posts
    1,111
    Thank Post
    119
    Thanked 90 Times in 78 Posts
    Rep Power
    37

    PHP settings file - web based editing?

    For our intranet, I have a php settings file (which I have appropriately named config.inc.php) and values from here are passed to various areas of the site (such as internet status etc). When we want to change the status, we modify the text in this settings file and this works well.

    For instance:
    Code:
    <?php
    $status[0] = "Internet down";
    $status[1] = "Email ok";
    $status[2] = "Network ok";
    ?>
    For the intranet index.php and other pages, I include this config file at the top then just have $status[x] echoed at the appropriate location.

    However, I was wondering if it is possible to be able to add an "edit" button next to the text (this would only be visible and editable by admins) and to be able to edit these values via the web interface?

    I have no problem doing the actual button and only allowing admin access to it, but what kind of php code is needed so that you can have a text box and submit button which will write back the values to the respective entries in the text file?

    Ideally, an edit button would be next to the status text on the intranet, clicking this turns it into a text box (or similar) where you can amend the text, then a save/submit button passes this back to the config.inc.php file and saves that.

    We're not fixing something that is broken, rather if possible making it easier to edit the text on the fly!

  2. #2
    dwhyte85's Avatar
    Join Date
    Mar 2009
    Location
    Berkshire
    Posts
    1,235
    Thank Post
    162
    Thanked 153 Times in 138 Posts
    Rep Power
    104
    If settings were in an INI File format / XML Format (personally, would go with INI) you could do this easily with the PHP INI funcs.



SHARE:
+ Post New Thread

Similar Threads

  1. AD: Block user settings GPO inheritance based on computer location
    By morganw in forum Windows Server 2000/2003
    Replies: 0
    Last Post: 23rd October 2009, 12:48 PM
  2. Editing an MSI file
    By Knopf in forum Windows
    Replies: 5
    Last Post: 4th March 2009, 05:35 PM
  3. Blacklist for web-based IM
    By uk101man in forum Wireless Networks
    Replies: 2
    Last Post: 22nd February 2007, 06:40 PM
  4. Web Based Email
    By saundersmatt in forum How do you do....it?
    Replies: 19
    Last Post: 14th February 2007, 02:49 PM
  5. PHP based Helpdesk with IMAP or POP3 authentication?
    By wesleyw in forum How do you do....it?
    Replies: 5
    Last Post: 18th October 2006, 02:08 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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