看板 PHP 關於我們 聯絡資訊
我的目標是使用者SUBMIT後,將處理結果以文字檔直接輸出給用戶。 如果我輸出完檔案,如果再顯示表單,那表單會一併進到文字檔中。 請問,有可能在檔案輸出(僅$s內容)後,再輸出HTML(顯示在browser中)嗎? <?php $s = mysql_escape_string($_POST['s']); header ('Content-Type: application/octet-stream'); header ('Content-Disposition: attachment; filename="test.ids"'); echo $s; ?> /*--- A ---*/ <form action = "" method = "post"> <input type = "text" name = "s"> <input type = "submit" value = "test"> </form> -- http://averywu.pixnet.net/blog/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.251.237.155
MOONRAKER:請用javascript多開一窗輸出文字檔。 10/01 00:15
danny8376:如果不用JS也可以掛iframe 總之分開讓客戶端載入 10/01 02:56