I am wanting to write to a config file on the fly and change the db set up for each client.
The vars are being passsed via a form.
I am using the following script
$fp2=fopen("test/".$fname."/config.inc.php", "a");
//set up the config.inc.php file information
$request2 = "
<?php
$GB_DB['dbName'] ='$var1';
$GB_DB['host'] = '$var2';
$GB_DB['user'] = '$var3';
$GB_DB['pass'] = '$var4';
?>
";
// write the message file
if (!fwrite($fp2, $request2))
{
print ("Cannot write to messageview file.");
}
I am getting an error message "expecting T_........."
Is this the best way of doing this ???? I thought the use of magic quotes would work but alas no.
Thanks for your ideas