Re: reading and writing a config
| From: | Burhan Khalid | Date: | Fri, 11 Apr 2003 19:50:44 +0000 |
| Subject: | Re: reading and writing a config | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143569@lists.php.net to get a copy of this message | ||
On Fri, 2003-04-11 at 10:15, David T-G wrote:
> Hi, all --
>
> I have a web page that is currently created statically but needs to be
> dynamically updated. I'd like for the user to be able to type in content
> in various places (name, contact phone, email, sales pitch, etcetc) and
> then save that somehow and then build my page from it.
>
Whenever I run into a situation like this, I generally have the user
create a XML file that my program parses (I wrote a generic XML parse
class that comes in handy for this).
The config file usually looks like this
<category>
<variable>value</variable>
..
So for database configuration :
<database>
<host>localhost</host>
etc.
I find that users are more comfortable with this approach than PHP
syntax because it reminds them of HTML.
If the user is really green, I write a small script that displays a form
where the user enters the values, then it generates the XML file that
the rest of the script uses for settings, etc.
--
Burhan Khalid
phplist[at]meidomus[dot]com
Please add a reply-to: header
in your messages that points
to the mailing list address
so that all mail is properly
archived and viewed.