This is also very long after this was posted but I'm having a similar problem- I've got one file that I read that has a bunch of variables in it that i would like my form's submission to fill in.
So I read that file and write to another hoping that the values have now been hardcoded in but they're not- it's just the same file that i read. no variable interpretation seems to happen with file read and file write.
Does anyone know the best way to do this? aside form using a db? i would know how to do that. There's got to be a way to read and write a file with the variables coming into the program. Should I put some code in here?
<?
$write_dir="./html/test.php";
$loc="./html/rates_test_out.php";
$fh=fopen($loc,"r");
$fileread=fread($fh,filesize($location));
$data=$fileread;
$fp = @fopen("$write_dir","w");
fwrite($fp, $data);
fclose($fp);
?>