{"id":1621,"date":"2021-03-06T21:16:20","date_gmt":"2021-03-06T12:16:20","guid":{"rendered":"https:\/\/www.dogrow.net\/hp\/?p=1621"},"modified":"2021-03-06T21:46:32","modified_gmt":"2021-03-06T12:46:32","slug":"blog105","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/hp\/blog105\/","title":{"rendered":"(105) \u8907\u6570\u306e submit\u30dc\u30bf\u30f3\u3092\u5224\u5225\u3059\u308b\u3002"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4e00\u3064\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306b\u3001\u8907\u6570\u306e submit\u30dc\u30bf\u30f3\u3092\u7f6e\u304d\u305f\u3044\u3068\u304d\u304c\u3057\u3070\u3057\u3070\u3042\u308b\u3002<\/p>\n<p>\u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e name\u3084 value\u3067\u5224\u5225\u3059\u308c\u3070\u3088\u3044\u306e\u3060\u304c\u3001<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001[\u7de8\u96c6]\u30dc\u30bf\u30f3\u3092\u5217\u6319\u3057\u305f\u3044\u30b1\u30fc\u30b9\u3067\u3061\u3087\u3063\u3068\u8ff7\u3063\u305f\u306e\u3067\u5099\u5fd8\u9332\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/hp\/wp-content\/uploads\/2021\/03\/i001-3.png\" alt=\"\" class=\"my_add_bs1\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b&#8230;<br \/>\n\u521d\u3081\u3066\u3053\u308c\u304c\u5fc5\u8981\u306a\u5834\u9762\u306b\u906d\u9047\u3057\u305f\u6642\u306b\u306f\u3001<br \/>\n<span class=\"my_fc_crimsonB\">\u3059\u3079\u3066\u306e submit\u3092\u72ec\u7acb\u3055\u305b\u308b\u305f\u3081\u306b\u3001\u305d\u308c\u305e\u308c\u3092 form\u3067\u56f2\u3080<\/span><br \/>\n\u3068\u3044\u3046\u5f37\u5f15\u306a\u65b9\u6cd5\u3067\u5b9f\u88c5\u3057\u305f\u3002<\/p>\n<p><span class=\"my_fc_crimsonB\">radio\u3067\u9078\u629e\u3057\u3066 submit\u3055\u305b\u308c\u3070\u3088\u3044\u306e\u3067\u306f\uff1f<\/span><br \/>\n\u3068\u601d\u3046\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u3072\u3068\u624b\u9593\u5897\u3048\u3066 2\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u306a\u308b\u306e\u3067\u3001\u64cd\u4f5c\u611f\u304c\u60aa\u5316\u3059\u308b\u3068\u611f\u3058\u3066\u3057\u307e\u3046\u3002<\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h3 class=\"my_h\">\u65b9\u6cd51 : name\u5c5e\u6027\u5024\u306b\u8b58\u5225\u5b50\u3092\u9023\u7d50\u3059\u308b\u3002<\/h3>\n<p>1) submit\u30dc\u30bf\u30f3\u306e name\u5c5e\u6027\u306b\u3001\u5404[\u7de8\u96c6]\u5bfe\u8c61\u306e\u7269\u306e\u8b58\u5225\u5b50\u3092\u9023\u7d50\u3059\u308b\u3002<br \/>\n\u3000<span class=\"my_fc_deeppinkB\">Edit_{\u8b58\u5225\u5b50}<\/span> \u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>2) \u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u3067 value=[\u7de8\u96c6] \u306e\u7269\u3092\u63a2\u3057\u3001\u305d\u306e name\u304b\u3089\u8b58\u5225\u5b50\u3092\u62bd\u51fa\u3059\u308b\u3002<\/p>\n<p>\u4ee5\u4e0b\u306b\u5b9f\u88c5\u3057\u305f\u3082\u306e\u3092\u7f6e\u3044\u305f\u3002<br \/>\n<a href=\"https:\/\/www.dogrow.net\/hp\/sample\/00105\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.dogrow.net\/hp\/sample\/00105\/<\/a><\/p>\n<p><span class=\"my_fc_blueBBig\">index.php<\/span><br \/>\n6\u884c\u76ee\u306e var_dump \u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u898b\u305f\u304b\u3063\u305f\u3060\u3051\u306a\u306e\u3067\u3001\u5b9f\u969b\u306e\u52d5\u4f5c\u306b\u306f\u4e0d\u8981\u306a\u547d\u4ee4\u3060\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\nmain();\r\nexit;\r\n\r\nfunction main(){    \/\/ \u4e3b\u5236\u5fa1\r\n  var_dump($_POST);           \/\/ \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u30c0\u30f3\u30d7\u3057\u3066\u773a\u3081\u3066\u307f\u308b\u3002\r\n  $html_add = '';\r\n  $ary_key = array_keys($_POST, '\u7de8\u96c6');\r\n  if(count($ary_key) &gt; 0){    \/\/ &#x5B;\u7de8\u96c6]\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\uff1f\r\n    $key = $ary_key&#x5B;0];\r\n    $id = explode('_', $key)&#x5B;1];\r\n    $html_add = '&lt;p&gt;&#x5B;\u7de8\u96c6]\u30dc\u30bf\u30f3'.$id.'\u756a\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\u3002&lt;\/p&gt;';\r\n  }\r\necho &lt;&lt;&lt; EOM\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=&quot;ja&quot;&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=&quot;utf-8&quot; \/&gt;\r\n  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; \/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  {$html_add}\r\n  &lt;form target=&quot;&quot; method=&quot;post&quot;&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit_1&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit_2&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit_3&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit_4&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit_5&quot; value=&quot;\u7de8\u96c6&quot;&gt;\r\n  &lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\nEOM;\r\n}\r\n<\/pre>\n<h3 class=\"my_h\">\u65b9\u6cd52 : name\u5c5e\u6027\u5024\u3092\u914d\u5217\u306b\u3059\u308b\u3002<\/h3>\n<p>\u65b9\u6cd51\u3067\u3082\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe\u3067\u304d\u305f\u3002<br \/>\n\u3067\u3082\u306a\u3093\u3060\u304b <span class=\"my_fc_crimsonB\">\u3061\u3087\u3063\u3068\u30c0\u30b5\u3044&#8230;<\/span><\/p>\n<p>name\u5c5e\u6027\u306f\u914d\u5217\u306b\u3067\u304d\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u5229\u7528\u3059\u308c\u3070\u3082\u3063\u3068\u30b9\u30de\u30fc\u30c8\u306b\u5b9f\u73fe\u3067\u304d\u305d\u3046\u3060\u3002<\/p>\n<p>1) submit\u30dc\u30bf\u30f3\u306e name\u5c5e\u6027\u3092\u914d\u5217\u306b\u3057\u3001\u305d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u8b58\u5225\u5b50\u3092\u4f7f\u3046\u3002<br \/>\n\u3000<span class=\"my_fc_deeppinkB\">Edit[{\u8b58\u5225\u5b50}]<\/span> \u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>2) \u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u3067 name=Edit \u306e\u7269\u3092\u63a2\u3057\u3001\u305d\u306e\u914d\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5024\u304b\u3089\u8b58\u5225\u5b50\u3092\u53d6\u5f97\u3059\u308b\u3002<\/p>\n<p>\u4ee5\u4e0b\u306b\u5b9f\u88c5\u3057\u305f\u3082\u306e\u3092\u7f6e\u3044\u305f\u3002<br \/>\n<a href=\"https:\/\/www.dogrow.net\/hp\/sample\/00105\/index2.php\" target=\"_blank\" rel=\"noopener\">https:\/\/www.dogrow.net\/hp\/sample\/00105\/index2.php<\/a><\/p>\n<p><span class=\"my_fc_blueBBig\">index.php<\/span><br \/>\n6\u884c\u76ee\u306e var_dump \u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u898b\u305f\u304b\u3063\u305f\u3060\u3051\u306a\u306e\u3067\u3001\u5b9f\u969b\u306e\u52d5\u4f5c\u306b\u306f\u4e0d\u8981\u306a\u547d\u4ee4\u3060\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\nmain();\r\nexit;\r\n\r\nfunction main(){    \/\/ \u4e3b\u5236\u5fa1\r\n  var_dump($_POST);           \/\/ \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u30c0\u30f3\u30d7\u3057\u3066\u773a\u3081\u3066\u307f\u308b\u3002\r\n  $html_add = '';\r\n  if(isset($_POST&#x5B;'Edit'])){  \/\/ &#x5B;\u7de8\u96c6]\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\uff1f\r\n    $id = key($_POST&#x5B;'Edit']);\r\n    $html_add = '&lt;p&gt;&#x5B;\u7de8\u96c6]\u30dc\u30bf\u30f3'.$id.'\u756a\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\u3002&lt;\/p&gt;';\r\n  }\r\necho &lt;&lt;&lt; EOM\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=&quot;ja&quot;&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=&quot;utf-8&quot; \/&gt;\r\n  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; \/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  {$html_add}\r\n  &lt;form target=&quot;&quot; method=&quot;post&quot;&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit&#x5B;1]&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit&#x5B;2]&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit&#x5B;3]&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit&#x5B;4]&quot; value=&quot;\u7de8\u96c6&quot;&gt;&lt;br \/&gt;\r\n    &lt;input type=&quot;submit&quot; name=&quot;Edit&#x5B;5]&quot; value=&quot;\u7de8\u96c6&quot;&gt;\r\n  &lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\nEOM;\r\n}\r\n<\/pre>\n<h1 class=\"my_h\">3. \u6240\u611f<\/h1>\n<p>\u30fb\u6b21\u56de\u3053\u308c\u304c\u5fc5\u8981\u306a\u5834\u9762\u306b\u906d\u9047\u3057\u305f\u3089\u3001\u4e0a\u8a18\u306e <span class=\"my_fc_deeppinkBBig\">\u65b9\u6cd52<\/span> \u3092\u4f7f\u3044\u305f\u3044\u3002<\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 \u4e00\u3064\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306b\u3001\u8907\u6570\u306e submit\u30dc\u30bf\u30f3\u3092\u7f6e\u304d\u305f\u3044\u3068\u304d\u304c\u3057\u3070\u3057\u3070\u3042\u308b\u3002 \u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e name\u3084 value\u3067\u5224\u5225\u3059\u308c\u3070\u3088\u3044\u306e\u3060\u304c\u3001 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001[\u7de8\u96c6]\u30dc\u30bf\u30f3\u3092\u5217\u6319\u3057\u305f\u3044\u30b1\u30fc\u30b9\u3067\u3061\u3087\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/hp\/blog105\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-1621","post","type-post","status-publish","format-standard","hentry","category-php"],"views":2482,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/comments?post=1621"}],"version-history":[{"count":16,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1621\/revisions"}],"predecessor-version":[{"id":1638,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/posts\/1621\/revisions\/1638"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/media?parent=1621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/categories?post=1621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/hp\/wp-json\/wp\/v2\/tags?post=1621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}