What I'm trying to do is to generate a file and specify the content in there without actually saving and creating the file on the server.
<link rel="stylesheet" href="css/style.css" />
<?php
if(isset($_POST['download'])){
header('Content-disposition: attachment; filename=testing.txt');
header('Content-type: text/plain');
echo 'Lorem Ipsum';
exit();
}
echo
'
<form method="POST" action="index.php">
<input type="submit" name="download" value="submit"/>
</form>
';
?>
The generated .txt file now contains content before <?php
whic is <link rel="stylesheet" href="css/style.css" />
and also Lorem Ipsum
, but I ONLY the want the content I specified which is just Lorem Ipsum