PDA

View Full Version : Well, problem about configure config.php


xiaodao
12-03-2004, 01:44 AM
i have seen many scripts with backend where you can enter all the values for ceteratin variables for example "background" and "site title" and many many more for your scripts
i just wonder how to do that, is it you chmd config.php to 777, then try to do something there. basically, i outruled database like mysql, i think it is a kind of abuse of resource to conncet to database just to enquire some variables value only
anybody any idea? thanks very much

schotte
12-03-2004, 08:25 AM
Hey,

what exactly is your question? How you can code the config.php, so that the config-variables are available to you, or how you can alter the config.php via the backend?

1) The file config.php just has declarations like

$background = "#FFFFFF";
$title = "My website";


With include("path/to/config.php"); you can then use those variables in files where you need them.

2) Have a look at file-altering functions like, fwrite, fputs, fread, fopen, fclose. That should help you.

Frank