{"id":670,"date":"2017-08-28T08:25:31","date_gmt":"2017-08-27T23:25:31","guid":{"rendered":"http:\/\/www.dogrow.net\/php\/?p=670"},"modified":"2018-08-25T22:24:48","modified_gmt":"2018-08-25T13:24:48","slug":"blog30","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/php\/blog30\/","title":{"rendered":"(30) \u3010WORDPRESS\u3011\u72ec\u81ea\u30ed\u30b0\u30a4\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b#2\uff08\u753b\u50cf\u5316\uff09"},"content":{"rendered":"<p>\u524d\u56de\u306e <a href=\"\/\/www.dogrow.net\/php\/?p=655\" target=_blank>(29) WordPress\u3067\u72ec\u81ea\u30ed\u30b0\u30a4\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b<\/a> \u3067\u306f\u3001WordPress\u306e\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306b\u30b9\u30d1\u30e0\u5bfe\u7b56\u306e\u305f\u3081\u306e\u72ec\u81ea\u306e\u8a8d\u8a3c\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057&#8230;<br \/>\nHTML\u30d5\u30a1\u30a4\u30eb\u4e2d\u306b\u8a8d\u8a3c\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u7c21\u5358\u306a\u69cb\u6587\u89e3\u6790\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u81ea\u52d5\u5165\u529b\u3055\u308c\u3066\u3057\u307e\u3046\u3002<br \/>\n\u3068\u3063\u3066\u3082\u7f8e\u3057\u3044\u30c6\u30ad\u30b9\u30c8\u306e\u305f\u3081\u3001MNIST\u7528\u7a0b\u5ea6\u306e\u7c21\u5358\u306a\u753b\u50cf\u8a8d\u8b58\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3082\u9ad8\u78ba\u7387\u3067\u5f53\u3066\u3089\u308c\u3066\u3057\u307e\u3046\u3002<br \/>\n<img decoding=\"async\" src=\"\/\/www.dogrow.net\/php\/wp-content\/uploads\/2017\/08\/Image4-4.png\" alt=\"\" class=\"my_img\" \/><\/p>\n<p>\u30d0\u30ec\u306b\u304f\u3044\u8a8d\u8a3c\u30b3\u30fc\u30c9\u306b\u3059\u308b\u306b\u306f\u3001\u3084\u306f\u308a\u6c5a\u753b\u50cf\u5316\u3059\u308b\u3057\u304b\u306a\u3044\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u540c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u6539\u9020\u3057\u3001\u6570\u5024\u6587\u5b57\u5217\u306e\u4ee3\u308f\u308a\u306b\u6570\u5024\u753b\u50cf\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u308b\u3002<br \/>\n\u672c\u5f53\u306f Imagick\u3067\u3044\u308d\u3044\u308d\u3068\u753b\u50cf\u3092\u898b\u3065\u3089\u304f\u6c5a\u3057\u305f\u304b\u3063\u305f\u306e\u3060\u304c\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3092\u8a2d\u7f6e\u3057\u3066\u3044\u308b\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u3067\u306f Imagick\u304c\u4f7f\u3048\u306a\u3044\u305f\u3081\u3001GD\u3067\u304c\u3093\u3070\u3063\u3066\u307f\u308b\u3002<\/p>\n<h1 class=my_h>\u25a0\u30d7\u30ed\u30b0\u30e9\u30e0<\/h1>\n<p>\u4eca\u56de\u306f\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u7684\u306b\u306f\u4f55\u3082\u65b0\u3057\u3044\u3053\u3068\u3092\u3057\u3066\u3044\u306a\u3044\u3002<br \/>\n\u6570\u5024\u6587\u5b57\u5217\u8868\u793a\u500b\u6240\u3092\u753b\u50cf\u306b\u5909\u3048\u305f\u3060\u3051\u3060\u3002<\/p>\n<h3 class=my_h>proc_add_login_field<\/h3>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n  public function proc_add_login_field() {\r\n    $my_path = plugins_url('gen_img.php',__FILE__);\r\necho &lt;&lt;&lt; EOM\r\n&lt;p style=&quot;text-align:center&quot;&gt;&lt;img src=&quot;{$my_path}&quot;&gt;&lt;\/p&gt;\r\n&lt;input type=&quot;text&quot; name=&quot;add_sec_code&quot; class=&quot;input&quot; value=&quot;&quot; \/&gt;\r\nEOM;\r\n  }\r\n<\/pre>\n<h3 class=my_h>gen_img.php<\/h3>\n<p>\u4e00\u751f\u61f8\u547d\u306b\u753b\u50cf\u3092\u6c5a\u3057\u3066\u307f\u305f\u304c\u3001\u307e\u3060\u307e\u3060\u6c5a\u3057\u8db3\u308a\u306a\u3044\u3068\u601d\u3046&#8230;<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n  session_start();\r\n  $_SESSION&#x5B;'MySecurityLoginOTT'] = $ott = sprintf(&quot;%04d&quot;, rand(0,9999));\r\n  $w = 40;\r\n  $h = 40;\r\n  $nlen = strlen($ott);\r\n  $w_all = $w * $nlen;\r\n  $ary_im = array();\r\n  for($i=0 ; $i &lt; $nlen ; $i++){\r\n    $im  = imageCreateTrueColor($w, $h);\r\n    $black = ImageColorAllocate ($im, 0, 0, 0);\r\n    ImageColorTransparent($im, $black);\r\n    imageFill($im, 0, 0, $black);\r\n    $col = imagecolorallocate($im, rand(128,255), rand(128,255), rand(128,255));\r\n    $c = substr($ott, $i, 1);\r\n    imagechar($im, rand(4,5), 0, 0, $c, $col);\r\n    $ary_im&#x5B;$i] = $im;\r\n  }\r\n  $im = imageCreateTrueColor($w_all, $h);\r\n  $gray = ImageColorAllocate ($im, 96, 96, 96);\r\n  $black = ImageColorAllocate ($im, 0, 0, 0);\r\n  imageFill($im, 0, 0, $gray);\r\n  ImageColorTransparent($im, $black);\r\n  $x = 0;\r\n  $y = 0;\r\n  for($i=0 ; $i &lt; $nlen ; $i++){\r\n    $pos_x = $x + rand(0,floor($w\/2));\r\n    $pos_y = rand(0,floor($h\/5));\r\n    imagecopy($im , $ary_im&#x5B;$i], $pos_x, $pos_y, 0, 0, $w, $h);\r\n    $x += $w;\r\n  }\r\n  $new_w = floor($w_all * 4\/3);\r\n  $new_h = floor($h * 4\/3);\r\n  $im2 = imageCreateTrueColor($new_w, $new_h);\r\n  imagecopyresized($im2, $im, 0, 0, 0, 0, $new_w, $new_h, $w_all, $h);\r\n  for($i=0; $i &lt; 1500 ; $i++){\r\n    $pos_x = rand(0, $new_w);\r\n    $pos_y = rand(0, $new_h);\r\n    $col = imagecolorallocate($im2, rand(128,255), rand(128,255), rand(128,255));\r\n    imagesetpixel($im2, $pos_x, $pos_y, $col);\r\n  }\r\n  header('Content-type: image\/png');\r\n  imagepng($im2);\r\n?&gt;\r\n<\/pre>\n<p>\u30c6\u30ad\u30b9\u30c8\u3068\u6bd4\u3079\u3066\u3060\u3044\u3076\u898b\u3065\u3089\u304f\u306a\u3063\u305f\u3060\u308d\u3046\u304b\uff1f<br \/>\n<img decoding=\"async\" src=\"\/\/www.dogrow.net\/php\/wp-content\/uploads\/2017\/08\/Image5.png\" alt=\"\" class=\"my_img\" \/><\/p>\n<p>\u524d\u56de\u306e <a href=\"\/\/www.dogrow.net\/php\/?p=655\" target=_blank>(29) WordPress\u3067\u72ec\u81ea\u30ed\u30b0\u30a4\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b<\/a> \u3068\u306e\u5927\u304d\u306a\u9055\u3044\u306f\u4ee5\u4e0b\u306e2\u70b9\u3060\u3002<br \/>\n1) HTML\u30d5\u30a1\u30a4\u30eb\u4e2d\u306b\u8a8d\u8a3c\u30b3\u30fc\u30c9\u304c\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u308b or not<br \/>\n2) \u8a8d\u8a3c\u30b3\u30fc\u30c9\u304c\u30c6\u30ad\u30b9\u30c8 or \u753b\u50cf<\/p>\n<h3 class=my_h>\u4eca\u5f8c\u306f&#8230;<\/h3>\n<p>\u5e7e\u4f55\u5b66\u6a21\u69d8\u306a\u3069\u3092\u6df7\u305c\u8fbc\u3093\u3067\u3001\u3055\u3089\u306b\u753b\u50cf\u3092\u898b\u3065\u3089\u304f\u3059\u308b\u3002<\/p>\n<hr class=my_hr_bottom>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e (29) WordPress\u3067\u72ec\u81ea\u30ed\u30b0\u30a4\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b \u3067\u306f\u3001WordPress\u306e\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306b\u30b9\u30d1\u30e0\u5bfe\u7b56\u306e\u305f\u3081\u306e\u72ec\u81ea\u306e\u8a8d\u8a3c\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u305f\u3002 \u3057\u304b\u3057&#8230; HTML\u30d5\u30a1\u30a4\u30eb\u4e2d\u306b\u8a8d\u8a3c\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u3066\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/php\/blog30\/\">\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":[6,11],"tags":[],"class_list":["post-670","post","type-post","status-publish","format-standard","hentry","category-gd","category-wordpress"],"views":2174,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/comments?post=670"}],"version-history":[{"count":11,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/670\/revisions"}],"predecessor-version":[{"id":1585,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/670\/revisions\/1585"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/media?parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/categories?post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/tags?post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}