Hi,
It's best if I give you the outline of what I'm hoping to achieve so bear with me.
I am developing a site where clients will purchase a self-maintained web site via a selection of templates. To set up a client I intend it to be 'click one button' and it's all done, no further work needed from me. I have a number of scripts that create a new directory on the server and then copies all the template files and creates all the blank database records needed. As all clients data will be held in one database they each have a unique id assigned when the database records are written. Each new directory has a session.php file that holds the Customer Id and Client Id.
Now rather than having to manually amend these values for each new client I create I want to create a file called session1.php via a script that I can have as an include in the session.php file . Here lies my problem.... I have tried several ways to create the file but I can't work out how to get the values in the php file. The script looks like this :
$filename = 'session1.php';
$Content = "$client_id = 1; $customer_id = 1;";
$handle = fopen($filename, 'x+');
fwrite($handle, $Content);
fclose($handle);
this gives a written file value of =1; =1;
and obviously it would (in hindsight) as there are no values in the fields. I even tried to use the html value for the dollar sign hoping that might confuse it and format it correctly but it was too smart for me....html value was written.
Does anyone know what do I need to do within the $Content field to get the full text string written?
Any help is appreciated and thanks for reading this far.