On 05 September 2003 19:44, Chris Sherwood wrote:
this is a sample of what I do when I need to write a php file
$stringtowrite = ?PHP\n// Bulletin Board
forum\n$.ForumId=.$tabletofind.;\n;
$stringtowrite .=
$.ForumActive='1';\n$.ForumName='.$sportname.';\n;
$stringtowrite .=
[snip]
I wish to use fwrite() to create a small PHP file. So far, when I
attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:
[/snip]
Vince I did this
?php
/*
** Write PHP with PHP
** 2003-09-05
*/
$newphp = fopen(/usr/server/test/new_php.php,
Vince,
You also need to escape the $, so instead of
. if ($_GET..
use
. if (\$_GET.
You may have to escape the single quotes.
I have written two pretty lame code generators. The first one did not use
templates, the second one does. You've got the lines of code in your
builder script.
Vince LaMonica wrote:
I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:
$new_id = mysql_insert_id();
// create brand new file
$new_file =
this is a sample of what I do when I need to write a php file
$stringtowrite = ?PHP\n// Bulletin Board
forum\n$.ForumId=.$tabletofind.;\n;
$stringtowrite .=
$.ForumActive='1';\n$.ForumName='.$sportname.';\n;
$stringtowrite .= $.ForumDescription='.$sportname. forum';\n;
5 matches
Mail list logo