<?php

if ($_COOKIE["export_txt"] == MD5('export_txt')) {

  $file = 'export_list.txt';

  header('Content-Description: File Transfer');
  header("Content-Type: text/plain");
  header('Expires: 0');
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Content-Disposition: attachment; filename=export_list.txt");
  header("Content-Length: " .filesize($file));
  header('Pragma: public');
  ob_clean();
  flush();
  @readfile($file);

}
else {

  print 'Permission denied';

}

?>