捕获输出,另存为文件


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.