This might help you get in the right direction.
Here is text.php
PHP Code:
<?php
header('Content-type: text/plain');
header('Content-disposition: attachment; filename="test.txt"');
readfile('[text.php]');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
here is test.txt
Code:
This should be downloaded.
If you link directly to text.php, a dialog box will be prompted to download the text file if your server supports this, I no reason why it shouldn't. Also this should be in the php forum, don't repost it, a mod will move this for you.