Pressing a button i create a new php file on the fly. This file has a $variable that holds the result of a MYSQL query.
The file as an echo $variable statement that is converted to the value the $variable holds upon creation of the new file.
I do not want this.
What i need is that echo $variable is written in the new file has echo $variable.
An similar example:
$contents = 'Home';
<?php echo Home; ?>
<?php echo $contents; ?>
Please check following code.
$data = '<?php'; $data .= 'echo $contend; ?>'; $h = fopen('file.php','w'); fwrite($h,$data); fclose();