{"id":1214,"date":"2021-05-21T11:41:08","date_gmt":"2021-05-21T02:41:08","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=1214"},"modified":"2021-07-25T11:59:49","modified_gmt":"2021-07-25T02:59:49","slug":"post-1214","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/05\/21\/1214\/","title":{"rendered":"javascript \u3067 POST \u3059\u308b(2)"},"content":{"rendered":"\n<p>\u3000\u6628\u65e5\u306e\u8aac\u660e\u3067\u306f\u5c11\u3057\u308f\u304b\u308a\u306b\u304f\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u5177\u4f53\u7684\u306a\u30da\u30fc\u30b8\u3092\u4f5c\u3063\u3066\u898b\u307e\u3057\u305f\u30021\u30da\u30fc\u30b8\u3060\u3051\u3067\u7570\u306a\u3063\u305f\u30da\u30fc\u30b8\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sirius-\u306e\u30d6\u30ed\u30b0 wp-block-embed-sirius-\u306e\u30d6\u30ed\u30b0\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"JPHckuuybz\"><a href=\"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/05\/20\/960\/\">javascript \u3067 POST \u3059\u308b<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;javascript \u3067 POST \u3059\u308b&#8221; &#8212; Sirius \u306e\u30d6\u30ed\u30b0\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/05\/20\/960\/embed\/#?secret=T9PkPKQkbb#?secret=JPHckuuybz\" data-secret=\"JPHckuuybz\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><figcaption>\u6628\u65e5\u306e\u8a18\u4e8b<\/figcaption><\/figure>\n\n\n\n<p>\u3000\u3053\u308c\u306f\u3001\u4f55\u306e\u305f\u3081\u306b\u308f\u3056\u308f\u3056\u8003\u3048\u305f\u306e\u304b\u3068\u8a00\u3046\u3068\u3001\u30a2\u30c0\u30eb\u30c8\u30b2\u30fc\u30e0\u95a2\u9023\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u5e74\u9f62\u78ba\u8a8d\u3092\u3057\u305f\u304b\u3063\u305f\u304b\u3089\u3067\u3059\u3002\u76f4\u30ea\u30f3\u30af\u3055\u308c\u3066\u3082\u304d\u3061\u3093\u3068\u5e74\u9f62\u78ba\u8a8d\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002\u305d\u308c\u306a\u3089\u3001\u78ba\u8a8d\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u308c\u3070\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3057\u305f\u304c\u3001\u7d50\u5c40\u3001\u30ea\u30f3\u30af\u306b\u66f8\u304f\u304b\u3001POST \u3067\u9001\u3089\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u30ea\u30f3\u30af\u306b\u66f8\u3044\u305f\u3089\u610f\u5473\u306f\u306a\u3044\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u30da\u30fc\u30b8\u306b form \u3092\u4f5c\u308b\u306e\u3082\u9762\u5012\u3060\u3063\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306b\u308f\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u306b 3 \u30d5\u30a1\u30a4\u30eb\u306b\u5206\u3051\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-size: 17px\" class=\"font-size\">page.php<\/span><br><span style=\"font-size: 17px\" class=\"font-size\">\u3053\u306e PHP \u3067 POST \u30c7\u30fc\u30bf\u3068\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<\/span><\/li><li><span style=\"font-size: 17px\" class=\"font-size\">post.html<\/span><br><span style=\"font-size: 17px\" class=\"font-size\">\u81ea\u5206\u306e\u30da\u30fc\u30b8\u3078 POST \u30c7\u30fc\u30bf\u3092\u9001\u308b html\u3067\u3059\u3002page.php \u306binclude \u3055\u308c\u307e\u3059\u3002<\/span><\/li><li><span style=\"font-size: 17px\" class=\"font-size\">clear.php<\/span><br><span style=\"font-size: 17px\" class=\"font-size\">\u30c6\u30b9\u30c8\u7528\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308bPHP<\/span>\u3067\u3059\u3002<\/li><\/ul>\n\n\n\n<p>\u3000\u305d\u308c\u305e\u308c\u306e\u5185\u5bb9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>page.php<\/p>\n\n\n\n<pre class=\"wp-block-code file\"><code>&lt;?php\nsession_start();\nif( isset($_POST&#91;'age']) &amp;&amp; $_POST&#91;'age'] == '18' ) {\n    $_SESSION&#91;'age'] = 'ok';\n} else {\n    if( ! isset($_SESSION&#91;'age']) || $_SESSION&#91;'age'] != 'ok' ) {\n        \/\/ javascript \u3067 POST \u30c7\u30fc\u30bf\u3092\u9001\u308b\u30da\u30fc\u30b8\u3092\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3057\u307e\u3059\u3002\n        include \"post.html\";\n        exit;\n    }\n}\n?&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ja\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;POST \u30c7\u30fc\u30bf\u78ba\u8a8d&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;p&gt;\u3042\u306a\u305f\u306f\u6210\u5e74\u3067\u3059\u306d\u3002&lt;\/p&gt;\nPOST \u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u3001\u305d\u306e\u5909\u6570\u304c\u6709\u52b9\u306a\u9593\u3001\u3053\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002&lt;br&gt;\n&lt;a href=\"clear.php\"&gt;\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u3002&lt;\/a&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>post.html<\/p>\n\n\n\n<pre class=\"wp-block-code file\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ja\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;\u78ba\u8a8d\u30da\u30fc\u30b8&lt;\/title&gt;\n  &lt;script&gt;\n    function post() {\n      xhr = new XMLHttpRequest();\n      xhr.open('POST', '#', true);\n      xhr.setRequestHeader('content-type', 'application\/x-www-form-urlencoded;charset=UTF-8');\n      var request = \"age=18\";\n      xhr.send(request);\n      location.reload();\n    }\n  &lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;h1&gt;\u5e74\u9f62\u78ba\u8a8d&lt;\/h1&gt;\n&lt;p&gt;\n  &lt;div&gt;\u3042\u306a\u305f\u306f 18 \u6b73\u4ee5\u4e0a\u3067\u3059\u304b\uff1f&lt;\/div&gt;\n  &lt;a href=\"#\" onclick=\"post(); return false;\"&gt;\u306f\u3044&lt;\/a&gt;\u3000\n  &lt;a href=\"#\" onclick=\"history.back(); return false;\"&gt;\u3044\u3044\u3048&lt;\/a&gt;\n&lt;\/p&gt;\n&lt;p&gt;\n  &lt;div&gt;\u30d5\u30a9\u30fc\u30e0\u3067 POST \u3059\u308b\uff08\u666e\u901a\u306e\u3084\u308a\u65b9\uff09\u3002&lt;\/div&gt;\n  &lt;form method=\"POST\" action=\"#\"&gt;\n    &lt;input type=\"hidden\" name=\"age\" value=\"18\"&gt;\n    &lt;input type=\"submit\" name=\"yes\" value=\"\u306f\u3044\"&gt;\n    &lt;input type=\"button\" name=\"no\" value=\"\u3044\u3044\u3048\" onClick=\"history.back();\"&gt;\n  &lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>clear.php<\/p>\n\n\n\n<pre class=\"wp-block-code file\"><code>&lt;?php\nsession_start();\nunset($_SESSION&#91;'age']);\n?&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ja\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;\u30bb\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u306e\u524a\u9664&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002&lt;br&gt;\n&lt;a href=\"#\" onclick=\"history.back(); return false;\"&gt;\u623b\u308b&lt;\/a&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>\u3000\u30d6\u30e9\u30a6\u30b6\u3067 <a href=\"https:\/\/sirius10.net\/SampleCode\/POST\/page.php\">\u30c6\u30b9\u30c8\u30da\u30fc\u30b8<\/a> \u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u6642\u3001\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u306e\u30da\u30fc\u30b8\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300chttps:\/\/sirius10.net\/SampleCode\/POST\/page.php\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"211\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post1.png\" alt=\"\" class=\"wp-image-1221\" srcset=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post1.png 341w, https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post1-300x186.png 300w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><figcaption>\u30da\u30fc\u30b8\u306e\u30a4\u30e1\u30fc\u30b8\uff11<\/figcaption><\/figure>\n\n\n\n<p>\u3000\u30ea\u30f3\u30af\u304b\u3001\u30d5\u30a9\u30fc\u30e0\u306e\u30dc\u30bf\u30f3\u306e\u300c\u306f\u3044\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u304c\u6b21\u306e\u3088\u3046\u306b\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"120\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post2.png\" alt=\"\" class=\"wp-image-1222\" srcset=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post2.png 696w, https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/05\/post2-300x52.png 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><figcaption>\u30da\u30fc\u30b8\u306e\u30a4\u30e1\u30fc\u30b8\uff12<\/figcaption><\/figure>\n\n\n\n<p>\u3000\u3053\u306e\u3068\u304d\u306e\u30a2\u30c9\u30ec\u30b9\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u524d\u3068\u5909\u308f\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u623b\u3063\u3066\u304f\u308c\u3070\u3001\u307e\u305f\u3001\u30da\u30fc\u30b8\u306e\u30a4\u30e1\u30fc\u30b8\uff11\u306e\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u30d5\u30a9\u30fc\u30e0\u306e POST \u3068\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001POST \u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002page.php \u306e php \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u90e8\u5206\u3092\u5e74\u9f62\u78ba\u8a8d\u3057\u305f\u3044\u5168\u3066\u306e\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308c\u3070\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u304c\u306a\u3044\u5834\u5408\u306f\u78ba\u8a8d\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u304c\u3042\u308c\u3070\u3001\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>2021.07.25 \u8ffd\u8a18<br>\u3000\u8a18\u4e8b\u5185\u306e JavaScript \u306f\u3001FireFox \u3067\u306f\u52d5\u304b\u306a\u3044\u3088\u3046\u3067\u3059\u3002JavaScript \u90e8\u5206\u306f\u6b21\u306e\u8a18\u4e8b\u306e JavaScript \u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sirius-\u306e\u30d6\u30ed\u30b0 wp-block-embed-sirius-\u306e\u30d6\u30ed\u30b0\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Ki9X4U0ZCr\"><a href=\"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/07\/25\/1750\/\">javascript \u3067 POST \u3059\u308b(3) &#8211; FireFox \u5bfe\u5fdc<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;javascript \u3067 POST \u3059\u308b(3) &#8211; FireFox \u5bfe\u5fdc&#8221; &#8212; Sirius \u306e\u30d6\u30ed\u30b0\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/07\/25\/1750\/embed\/#?secret=kM2rxfgmAY#?secret=Ki9X4U0ZCr\" data-secret=\"Ki9X4U0ZCr\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><figcaption>FireFox \u5bfe\u5fdc<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u6628\u65e5\u306e\u8aac\u660e\u3067\u306f\u5c11\u3057\u308f\u304b\u308a\u306b\u304f\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u5177\u4f53\u7684\u306a\u30da\u30fc\u30b8\u3092\u4f5c\u3063\u3066\u898b\u307e\u3057\u305f\u30021\u30da\u30fc\u30b8\u3060\u3051\u3067\u7570\u306a\u3063\u305f\u30da\u30fc\u30b8\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3000\u3053\u308c\u306f\u3001\u4f55\u306e\u305f\u3081\u306b\u308f\u3056\u308f\u3056\u8003\u3048\u305f\u306e\u304b\u3068\u8a00\u3046\u3068\u3001\u30a2\u30c0\u30eb\u30c8\u30b2\u30fc\u30e0\u95a2\u9023\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u308b\u306b\u3042\u305f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1214","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=1214"}],"version-history":[{"count":14,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1214\/revisions"}],"predecessor-version":[{"id":1763,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1214\/revisions\/1763"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=1214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=1214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=1214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}