(ページの作成: == Internet Explorer の情報バー == *IE + Windows XP SP2でダウンロードブロックの情報バーが表示されますが、抑止できないのでしょうか。 ...) |
(→検証用ソース) |
||
32行目: | 32行目: | ||
=== 検証用ソース === | === 検証用ソース === | ||
+ | <pre> | ||
+ | <?php | ||
+ | if (isset($_POST['exec']) && $_POST['exec'] == '1') { | ||
+ | header("Content-type: text/plain"); | ||
+ | header("Content-Disposition: attachment; filename=\"testfile.txt\""); | ||
+ | echo "this is test file.\n"; | ||
+ | exit(); | ||
+ | } | ||
+ | ?> | ||
+ | <html> | ||
+ | <HEAD> | ||
+ | <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=UTF-8"> | ||
+ | <title>ファイルダウンロード</title> | ||
+ | <script language="JavaScript"> | ||
+ | window.onload = function() { | ||
+ | if (document.all.confirmform.confirm.value == '1') { | ||
+ | alert("ダウンロードします"); | ||
+ | document.all.downloadform.submit(); // ダウンロードリクエストする | ||
+ | } | ||
+ | } | ||
+ | </script> | ||
+ | </HEAD> | ||
+ | <body> | ||
+ | <div>ファイルダウンロード</div> | ||
+ | <form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST" name="confirmform"> | ||
+ | <input type="hidden" name="confirm" value="<?php echo $_POST['confirm'] ?>" /> | ||
+ | <input type="button" value="確認+ダウンロード" onclick="document.all.confirmform.confirm.value=1;document.all.confirmform.submit();" /> | ||
+ | </form> | ||
− | + | <form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST" name="downloadform"> | |
− | + | <input type="hidden" name="exec" value="1" /> | |
− | + | <input type="button" value="ダウンロード" onclick="document.all.downloadform.submit();" /> | |
− | + | </form> | |
− | + | ||
− | + | <body> | |
− | + | <html> | |
− | + | </pre> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
<?php if (isset($_POST['exec']) && $_POST['exec'] == '1') { header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=\"testfile.txt\""); echo "this is test file.\n"; exit(); } ?> <html> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=UTF-8"> <title>ファイルダウンロード</title> <script language="JavaScript"> window.onload = function() { if (document.all.confirmform.confirm.value == '1') { alert("ダウンロードします"); document.all.downloadform.submit(); // ダウンロードリクエストする } } </script> </HEAD> <body> <div>ファイルダウンロード</div> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST" name="confirmform"> <input type="hidden" name="confirm" value="<?php echo $_POST['confirm'] ?>" /> <input type="button" value="確認+ダウンロード" onclick="document.all.confirmform.confirm.value=1;document.all.confirmform.submit();" /> </form> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST" name="downloadform"> <input type="hidden" name="exec" value="1" /> <input type="button" value="ダウンロード" onclick="document.all.downloadform.submit();" /> </form> <body> <html>Tweet