Hi everyone.
How can I write a variable to a file?
if (isset($HTTP_POST_VARS["radd"])){
$POINT = "HERE";
$EDIT_FILE = "C:\MySites\bookstore\Admin\conf.php";
$file_array = file($EDIT_FILE);
$file = join ("", $file_array);
$nwriter = $HTTP_POST_VARS["writer"];
$ntitle = $HTTP_POST_VARS["title"];
$npages = $HTTP_POST_VARS["pages"];
$add = "&36;writer .= '$nwriter';\n";
$add .= "&36;title .= '$ntitle';\n";
$add .= "&36;pages .= '$npages';\n";
$add .= $POINT;
$file = preg_replace("/$MOTIF/", $add, $file);
$fp = fopen("$EDIT_FILE", "w");
//flock($fp, 1);
fputs($fp, $file);
//flock($fp, 3);
fclose($fp);
}
The above is supposed to write to a file this:
$title .= 'THE TITLE';
$writer .= 'THE WRITER';
$pages .= 'THE PAGES';
$cost .= 'THE COST';
How can i do this?