I have some text that is the result of a lot of form inputs that I would like to write to the users disk..
I have been thinking of using somthing like the following, but am new to PHP and would like some pointers as to why this is not working..
<?php
// $dl is the text to be written to the file
// $filename is the file name ?
// no need to go anywhere after this, since the file downloads straight from the link.
header("Content-Disposition: atachment; filename=$filename");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize("$filename"));
header("Pragma: no-cache");
header("Expires: 0");
echo $dl;
exit();
?>
I can write the file, but the file is empty...