
09-04-2007
|
| Administrator
Join Date: Jun 2007
Posts: 3,729
BRL$: 35,026.65 Thanks: 0
Thanked 7 Times in 7 Posts
Rep Power: 406 | | Using PHP to generate html files using variables 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? To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ █ High Quality To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ Powerful To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
To receive latest updates about BRL Forums, Subscribe to Latest Updates Thread.
| | | |