first create a form which passes the variables to this script
i am personaly using this script for the connection settings to my db
this script is only used at the installation, then all parts of my script read the db info out of it
please be sure to chmod this file 777 or simular b4 writing to it
<?php
$write = "<?php\n\n";
$write .= "\$hostname = \"$hostname\";\n";
$write .= "\$dbname = \"$dbname\";\n";
$write .= "\$dbusername = \"$dbusername\";\n";
$write .= "\$dbpass = \"$dbpass\";\n";
$write .= "\$prefix = \"$prefix\";\n\n";
$write .= "?>";
if(@$file = fopen("dbinfo.php", "w")) {
fputs($file, $write);
fclose($file);
}
also possible would be if you want a script which tracks down all error messages
class logFile {
var $filename;
function logFile($file) {
$this->filename = $file;
}
function write($message) {
$fc = fopen($this->filename, "a+");
$w = fwrite ($fc, $message);
fclose($fc);
}
}
//set file name
$logFile = new logFile("errors.log");
//for writing to it use then:
$logFile->write("Error: ...<br />");