www.webdeveloper.com
Results 1 to 2 of 2

Thread: Single Page to read and update config file

  1. #1
    Join Date
    Feb 2012
    Posts
    8

    Single Page to read and update config file

    I am constructing a config file for certain variables to be used in a script that will be changed from time to time, and would like to make any changes all via a single webpage.

    The config file is a .txt flat file with entries like this:

    $variable1 = "sometext";
    $variable2 = "somenumber";

    On the single update page, I plan to use a separate SUBMIT button so that changes will ONLY be made to the desired $variable in the config file.

    When loading single page with multiple fields from the config file, each of the $variable fields needs to be populated with the current $variable settings so I can see the current status before making any changes.

    There must be a simple way to do this. Maybe?

    Thanks very much for any assistance.

    Ciao,

    StuckInLimbo

  2. #2
    Join Date
    Feb 2012
    Posts
    8
    Sorry, I forgot to mention the single page for updating will be php, but with the form in html something like this (unless it requires all php to work):

    <html>
    <head>
    <title>CONFIG UPDATE</title>
    </head>
    <body>

    <FORM METHOD="POST" ACTION="<?=$_SERVER['PHP_SELF'];?>">
    Variable #1: <INPUT NAME="variable1" type="text" size=6 maxlength="10" value="">
    <INPUT name="submit" type="submit" class=submitbutton value="UPDATE">
    <INPUT name="reset" type="reset" class=resetbutton value="RESET">
    </FORM>

    <FORM METHOD="POST" ACTION="<?=$_SERVER['PHP_SELF'];?>">
    Variable #2: <INPUT NAME="variable2" type="text" size=6 maxlength="10" value="">
    <INPUT name="submit" type="submit" class=submitbutton value="UPDATE">
    <INPUT name="reset" type="reset" class=resetbutton value="RESET">
    </FORM>

    </body>
    </html>

    ... But with about 10 entries.

    Thank you.

    StuckInLimbo

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
  •  
HTML5 Development Center



Recent Articles