|
i'm using this script to create / generate a new .html file and it works fine, but....
// MAKE FILE indes.html
$filename = "index.html";
$fp = fopen($filename,"w") or die ("Error Opening File");
fputs($fp,$content);
fclose($fp);
...now i want to replace the "index" with any variable ie: $varname
$varname = "newname";
$filename = "$varname.html";
$fp = fopen($filename,"w") or die ("Error Opening File");
fputs($fp,$content);
fclose($fp);
it should generate the file newname.html but it's not working, can someone please let me know how to make this work?
|