Posted By

lzyy on 09/16/08


Tagged


Versions (?)

捕获输出,另存为文件


 / Published in: PHP
 

URL: http://bbs.blueidea.com/viewthread.php?tid=2833839

  1. if ($_POST['content']) {
  2. header ("Content-type: octet/stream");
  3. if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) {
  4. header("Content-Disposition: filename=tmp.php"); // For IE
  5. } else {
  6. header("Content-Disposition: attachment; filename=tmp.php"); // For Other browsers
  7. }
  8. echo $_POST['content'];
  9. }

Report this snippet  

You need to login to post a comment.