I found this script online. Can I only pass plain text to my new files? Or can I pass PHP script as well? If not through this script, are there other methods possible with PHP where I would be able to create files on my server with more advanced features? Thanks.
<?php
$filename = 'test.php';
$Content = "Add this to the file\r\n";
echo "open";
$handle = fopen($filename, 'x+');
echo " write";
fwrite($handle, $Content);
echo " close";
fclose($handle);
/*
if($handle = fopen($filename, 'a')){
if(is_writable($filename)){
if(fwrite($handle, $content) === FALSE){
echo "Cannot write to file $filename";
exit;
}
echo "The file $filename was created and written successfully!";
fclose($handle);
}
else{
echo "The file $filename, could not written to!";
exit;
}
}
else{
echo "The file $filename, could not be created!";
exit;
}*/
?>