/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@StuckInLimboauthorMar 08.2012 — 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
×

Success!

Help @StuckInLimbo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...