[solved] writing to a config file
Posted: Mon May 29, 2006 8:21 am
I'm working on a setup.php script to write a config.inc.php file after the user inputs data and the data is validated.
I'm writing $somecontent to the file. $somecontent is at the moment made up of
When, its finished the config.inc.php looks like this
which when used creates this error
I've tried various options of tryin to get newlines written to the file \n, \r\n etc, but no luck on my Xxamp windows installation or a linux server.
What have I done wrong?
I'm writing $somecontent to the file. $somecontent is at the moment made up of
Code: Select all
$somecontent = '<?php $adminpassword=';
$somecontent .=$adminpassword;
$somecontent .=';\n $moderate=';
$somecontent .=$moderate;
$somecontent .=';\n $postsperpage=';
$somecontent .=$postsperpage;
$somecontent .='; ?> ';Code: Select all
<?php $adminpassword=3bad6af0fa4b8b330d162e19938ee981;\n $moderate=y;\n $postsperpage=1; ?>Code: Select all
Parse error: syntax error, unexpected T_STRING in /home/amoyle/public_html/guestbook/config.inc.php on line 1What have I done wrong?