I'm looking for some help with the fwrite() function. I want to write some software that takes user input and basically outputs a few functional php files in to a sub-directory.
I want to have a script to write a file called project1/select.php that looks like this;
<?
$qry = mysql_query("select * from tableName where id='$id'");
$result = mysql_query($qry);
$row = mysql_fetch_array($result);
?>
so here is what I've tried;
$content = "<? $"."qry = mysql_query(\"select * from tableName where id='$"."id' \"); ";
$content .= "$"."result = .... etc and so forth, you get the point.
then fopen and fwrite
Anyway, I keep getting an error. It seems like when it registers the '$content' variable it parses it as PHP code and thus opens/closes the <? tag , terminating the code that comes underneath it and f'n up the whole script.
basically I'm wondering if there is a way that you can make it 'ignore' the tags or set it to a definite variable type string..
If anyone can help me please.......