reading and writing a config

From: Date: Fri, 11 Apr 2003 15:15:58 +0000
Subject: reading and writing a config
Groups: php.general 
Request: Send a blank email to php-general+get-143517@lists.php.net to get a copy of this message
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. I could have a single massive config array (or perhaps a number of arrays, but the method is the same) that stores each variable, and then I write that somewhere (serialize and mebbe base64) at edit time and read from it every time the page is loaded, but that means that you can then *only* go through my web interface, and many folks here are used to editing an include file like <?php $name = "my name" ; $tel = "123/456-7890" ; $slogan = "We're the best of the rest" ; ?> which we then include() in our code. Is there any approach to parsing an include file like that? It's fairly free-form; I don't know the variables that will be in there and there will be comments of all kinds as well as blank lines. TIA & HAND :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#143517) next »