I am trying to make make a visitor download text file when visiting a certain page. This is the page:
<?php
$file_url = 'text.txt';
header("Content-Disposition: attachment; filename=\"" . basename($file_url) . "\"");
header("Content-Type: application/force-download");
header("Content-Length: " . filesize($file_url));
header("Connection: close");
readfile($file_url)
?>
However, the file just shows up in the browser, in stead of asking for downloading. What am i doing wrong?