{"id":4455,"date":"2013-03-30T15:24:52","date_gmt":"2013-03-30T06:24:52","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=4455"},"modified":"2021-03-03T11:05:15","modified_gmt":"2021-03-03T02:05:15","slug":"php-%e4%bc%9a%e5%93%a1%e5%88%b6%e3%82%b5%e3%82%a4%e3%83%88%e3%81%ae%e5%88%b6%e4%bd%9c%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=4455","title":{"rendered":"PHP \u4f1a\u54e1\u5236\u30b5\u30a4\u30c8\u306e\u5236\u4f5c\u65b9\u6cd5"},"content":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u6c17\u5206\u3092\u5909\u3048\u3066\u4f1a\u54e1\u5236\u306e\u30b5\u30a4\u30c8\u5236\u4f5c\u65b9\u6cd5\u3092\u3002<\/p>\n<p>\u3068\u8a00\u3063\u3066\u3082\u57fa\u790e\u7684\u306a\u90e8\u5206\u3068\u306a\u308a\u307e\u3059\u304c\u3002<\/p>\n<p>\u30b4\u30ea\u30b4\u30ea\u66f8\u3044\u3066\u3044\u308b\u30a8\u30f3\u30b8\u30cb\u30a2\u3055\u3093\u306a\u3089\u3042\u308c\u3067\u3059\u304c\u3001\u3084\u3063\u3071\u66f8\u3044\u3066\u3044\u306a\u3044\u3068\u5fd8\u308c\u308b\u306e\u304c\u4eba\u9593\u3060\u3063\u305f\u308a\u3082\u3059\u308b\u306e\u3067\u3001\u601d\u3044\u51fa\u3059\u306e\u3082\u542b\u3081\u3066\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u307e\u305a\u5236\u4f5c\u306e\u30d5\u30ed\u30fc\u304b\u3089\u3002<\/p>\n<h4>\u5236\u4f5c\u30d5\u30ed\u30fc<\/h4>\n<p>\u307e\u305a\u884c\u3044\u305f\u3044\u306e\u306f\u3001<\/p>\n<p><strong>\u30e6\u30fc\u30b6\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u767b\u9332<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u4eee id\u767a\u884c \u30e1\u30fc\u30eb\u9001\u4fe1<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u672c\u767b\u9332\u30da\u30fc\u30b8\u8868\u793a<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u30e6\u30fc\u30b6\u30fcid\u3001\u540d\u524d\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u767b\u9332\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5165\u529b<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u672c\u767b\u9332\u5b8c\u4e86<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3067\u767b\u9332\u5185\u5bb9\u5165\u529b<\/strong><\/p>\n<p>\u2193<\/p>\n<p><strong>\u4f1a\u54e1\u5236\u306e\u30da\u30fc\u30b8\u8868\u793a<\/strong><\/p>\n<p>\u3068\u3044\u3046\u6d41\u308c\u3092\u884c\u3044\u305f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u65e9\u901f\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u3092\u884c\u306a\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>mysql\u306b\u95a2\u3057\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u81f4\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/?cat=35\" target=\"_blank\" rel=\"noopener\">https:\/\/www.webcyou.com\/?cat=35<\/a><\/p>\n<p>\u958b\u767a\u74b0\u5883\u306fUnix\u3068\u306a\u308a\u307e\u3059\u3002Mac\u3068MAMP\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<h4>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210<\/h4>\n<p>mysql\u306b\u7ba1\u7406\u8005\u6a29\u9650\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mysql -u root -p<\/pre>\n<p><strong>create database<\/strong>\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f<strong>\u300cmember_test\u300d<\/strong>\u3067\u9032\u3081\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">create database member_test;<\/pre>\n<p><strong>show databases<\/strong>\u3067\u4f5c\u6210\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u78ba\u8a8d\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">show databases;<\/pre>\n<p>\u4f5c\u6210\u3057\u305f<strong>\u300cmember_test\u300d<\/strong>\u3092\u4f7f\u3046\u30b3\u30de\u30f3\u30c9 <strong>use member_test<\/strong>\u3092\u5165\u529b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">use member_test;<\/pre>\n<p><strong>\u300cshow tables\u300d<\/strong>\u3067\u73fe\u5728\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">show tables;<\/pre>\n<p>\u3082\u3061\u308d\u3093\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3059\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>Empty \u4f55\u3082\u306d\u30fc\u3088\u3002\u3068\u8a00\u3046\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Empty set (0.00 sec)<\/pre>\n<p>\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>userid\uff1a\u30e6\u30fc\u30b6\u30fcID<\/strong><\/p>\n<p><strong>password\uff1a\u30d1\u30b9\u30ef\u30fc\u30c9<\/strong><\/p>\n<p><strong>name\uff1a\u30e6\u30fc\u30b6\u30fc\u306e\u540d\u524d<\/strong><\/p>\n<p><strong>email\uff1a\u30e6\u30fc\u30b6\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/strong><\/p>\n<p>\u3092\u7528\u610f\u3057\u307e\u3059\u3002 varchar(255)\u3067\u4f5c\u6210\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">create table members( userid varchar(255), password varchar(255), name varchar(255), email varchar(255));<\/pre>\n<p>\u30ea\u30bf\u30fc\u30f3\uff01\u3059\u308b\u3068\u3001Ok\u30b5\u30a4\u30f3\u304c\u8868\u793a\u3059\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Query OK, 0 rows affected (0.05 sec)<\/pre>\n<p>\u30ab\u30e9\u30e0\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u30fc\u3002<\/p>\n<p><strong>show columns<\/strong>\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">show columns from members;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4457\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-29 1.41.17\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/6ad1fd581c58fb72e27a6a9977e10446.png\" alt=\"\" width=\"419\" height=\"111\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/6ad1fd581c58fb72e27a6a9977e10446.png 419w, https:\/\/www.webcyou.com\/wp-content\/uploads\/6ad1fd581c58fb72e27a6a9977e10446-300x79.png 300w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><\/p>\n<p>\u78ba\u8a8d\u3067\u304d\u305f\u3068\u3053\u308d\u3067\u3001\u4eeeid\u756a\u53f7\u7528\u306e\u30ab\u30e9\u30e0\u304c\u8db3\u308a\u306a\u3044\u4e8b\u306b\u6c17\u3065\u3044\u305f\u306e\u3067\u8ffd\u52a0\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u8ffd\u52a0\u3059\u308b\u969b\u306f\u3001<strong>\u300cALTER TABLE \u8868\uff11 ADD (\u5217\uff11,\u5217\uff12&#8230;)\u300d<\/strong>\u3067\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u69d8\u306b\u8ffd\u52a0\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alter table members add pre_userid int;<\/pre>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001\u30ab\u30e9\u30e0\u306e\u5b9a\u7fa9\u7b49\u3092\u5909\u66f4\u3059\u308b\u969b\u306f\u3001<strong>\u300cALTER TABLE \u8868\uff11 CHANGE \u00a0\u5909\u66f4\u524d\u306e\u5217\uff11\u5909\u66f4\u5f8c\u306e\u5217\uff11 \u305d\u306e\u4ed6\u306e\u5b9a\u7fa9..\u300d<\/strong><\/p>\n<p>\u3067\u5909\u66f4\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u8a66\u3057\u306b<strong>PRIMARY KEY<\/strong>\u306e\u8ffd\u52a0\u3068\u3001<strong>NOT NULL<\/strong>\u3068\u3001<strong>AUTO_INCREMENT<\/strong>\u306e\u8ffd\u52a0\u3092\u884c\u306a\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alter table members change pre_userid pre_userid int not null primary key auto_increment;<\/pre>\n<p>\u8ffd\u52a0\u3055\u308c\u305f\u306e\u304c\u78ba\u8a8d\u51fa\u6765\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/02d49bc6e32ebbfd4dfdfaf4aefe59a9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4456\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-29 1.59.43\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/02d49bc6e32ebbfd4dfdfaf4aefe59a9.png\" alt=\"\" width=\"499\" height=\"127\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/02d49bc6e32ebbfd4dfdfaf4aefe59a9.png 499w, https:\/\/www.webcyou.com\/wp-content\/uploads\/02d49bc6e32ebbfd4dfdfaf4aefe59a9-300x76.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alter table members change pre_userid pre_userid int;<\/pre>\n<p>\u307e\u305f\u3001\u5909\u66f4\u3057\u3066\u307f\u307e\u3059\u3002\u5148\u307b\u3069\u8ffd\u52a0\u3057\u305f\u5206\u3092\u7701\u3044\u3066\u307f\u308b\u3068\u3001<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/725df4c82f989e4e0bb394b8cb0195bb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4458\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-29 2.19.25\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/725df4c82f989e4e0bb394b8cb0195bb.png\" alt=\"\" width=\"448\" height=\"137\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/725df4c82f989e4e0bb394b8cb0195bb.png 448w, https:\/\/www.webcyou.com\/wp-content\/uploads\/725df4c82f989e4e0bb394b8cb0195bb-300x91.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/a><\/p>\n<p>\u3068\u306a\u308b\u306e\u304c\u78ba\u8a8d\u51fa\u6765\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u7279\u306bPRIMARY KEY\u306e\u8a2d\u5b9a\u3082\u884c\u306a\u308f\u306a\u3044\u306e\u3067\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<p>\u524a\u9664\u3059\u308b\u969b\u306f\u3001\u300c<strong>DROP PRIMARY KEY<\/strong>\u300d\u3067\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alter table members drop primary key;<\/pre>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/f6da95a03acb21c7187db70176fce010.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4459\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-29 2.19.33\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/f6da95a03acb21c7187db70176fce010.png\" alt=\"\" width=\"428\" height=\"123\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/f6da95a03acb21c7187db70176fce010.png 428w, https:\/\/www.webcyou.com\/wp-content\/uploads\/f6da95a03acb21c7187db70176fce010-300x86.png 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/a><\/p>\n<p>\u300c<strong>DROP PRIMARY KEY<\/strong>\u300d\u3092\u524a\u9664\u51fa\u6765\u305f\u306e\u304c\u78ba\u8a8d\u51fa\u6765\u307e\u3057\u305f\u3002<\/p>\n<p>\u3088\u3057\u3001\u7d42\u4e86\u30fc\u3002\u3068\u601d\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u3001pre_userid\u306f\u6570\u5b57\u3068\u6587\u5b57\u5217\u306e\u4e71\u6570\u6587\u5b57\u5217\u306b\u3057\u307e\u3059\u306e\u3067\u3001<\/p>\n<p>VARCHAR\uff08255\uff09\u3067\u8a2d\u5b9a\u3057\u76f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alter table members change pre_userid pre_userid varchar(255);<\/pre>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/1d29b9b3ddbb25e3ea72e00ea4faf097.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4460\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-29 2.25.50\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/1d29b9b3ddbb25e3ea72e00ea4faf097.png\" alt=\"\" width=\"431\" height=\"124\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/1d29b9b3ddbb25e3ea72e00ea4faf097.png 431w, https:\/\/www.webcyou.com\/wp-content\/uploads\/1d29b9b3ddbb25e3ea72e00ea4faf097-300x86.png 300w\" sizes=\"auto, (max-width: 431px) 100vw, 431px\" \/><\/a><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u4e00\u65e6\u3053\u308c\u3067\u5b8c\u4e86\u3002<\/p>\n<p>\u7d9a\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u6e96\u5099\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>\u6e96\u5099\u3059\u308b\u30d5\u30a1\u30a4\u30eb<\/h4>\n<p><strong>db.php \uff1a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u63a5\u7d9a\u8a2d\u5b9a<\/strong><\/p>\n<p><strong>email_form.php\uff1aemail\u767b\u9332\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/strong><\/p>\n<p><strong>email_regist.php\uff1a\u30e6\u30fc\u30b6\u306e\u4eee\u767b\u9332\u3068\u767b\u9332\u30da\u30fc\u30b8URL\u306e\u9001\u4fe1\u7528\u30d5\u30a1\u30a4\u30eb<\/strong><\/p>\n<p><strong>regist_form.php\uff1a\u4eee\u767b\u9332\u306e\u30c1\u30a7\u30c3\u30af\u3068\u4f1a\u54e1\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u30d5\u30a1\u30a4\u30eb<\/strong><\/p>\n<p><strong>regist_confirm.php\uff1a\u4f1a\u54e1\u767b\u9332\u5185\u5bb9\u78ba\u8a8d\u753b\u9762\u30d5\u30a1\u30a4\u30eb<\/strong><\/p>\n<p><strong>user_regist.php\uff1a\u4f1a\u54e1\u767b\u9332\u3068\u767b\u9332\u5185\u5bb9\u9001\u4fe1\u30d5\u30a1\u30a4\u30eb<\/strong><\/p>\n<p><strong>index.php\uff1a\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u51e6\u7406\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30da\u30fc\u30b8<\/strong><\/p>\n<p>\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u3067\u306f\u3001\u65e9\u901f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u63a5\u7d9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3068\u540c\u69d8\u3067\u3059\u304c\u3001\u6539\u3081\u3066\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/?p=916\"><strong>MySQL \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u63a5\u7d9a\u3059\u308b\u969b\u306b\u8a18\u8ff0\u3059\u308b \u57fa\u672cPHP<\/strong><\/a><\/p>\n<h4><strong>db.php \uff1a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u63a5\u7d9a\u8a2d\u5b9a<\/strong><\/h4>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/*\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u63a5\u7d9a\u8a2d\u5b9a*\/\r\n$server = &quot;localhost&quot;;\r\n$user = &quot;root&quot;;\r\n$password = &quot;root&quot;;\r\n$dbname = &quot;member_test&quot;;\r\n\r\n\/*\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a*\/\r\n$conn = mysql_connect($server, $user, $password);\r\nmysql_select_db($dbname);\r\n<\/pre>\n<p>db.php\u306b\u4e0a\u8a18\u3092\u8a18\u8ff0\u3002\u4eca\u56de\u3001MAMP\u3092\u4f7f\u3044\u958b\u767a\u3057\u3066\u3044\u308b\u306e\u3067$server\u306flocalhost\u3001$user\u3001$password\u306f\u5171\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306eroot\u3001$dbname\u306f\u5148\u307b\u3069\u7528\u610f\u3057\u305f\u300cmember_test\u300d\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u305e\u308c\u306e\u63a5\u7d9a\u8a2d\u5b9a\u3092\u5165\u529b\u3057\u3001mysql_connect();\u3067MySQL\u306b\u63a5\u7d9a\u3001mysql_select_db();\u3067MySQL\u306e\u9078\u629e\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h4>email_form.php\uff1aemail\u767b\u9332\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h4>\n<p>\u7d9a\u3044\u3066\u7528\u610f\u3059\u308b\u306e\u306f\u3001email\u767b\u9332\u7528\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<strong>email_form.php<\/strong>\u3092\u7528\u610f\u81f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&lt;form action=&quot;index.php&quot; method=&quot;post&quot;&gt;&lt;input name=&quot;mode&quot; type=&quot;hidden&quot; value=&quot;email_regist&quot; \/&gt;\r\n&lt;table&gt;&lt;caption&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u767b\u9332\u30d5\u30a9\u30fc\u30e0&lt;\/caption&gt;\r\n&lt;tbody&gt;\r\n&lt;tr&gt;\r\n&lt;td class=&quot;item&quot;&gt;E-mail\uff1a&lt;\/td&gt;\r\n&lt;td&gt;&lt;input name=&quot;email&quot; size=&quot;40&quot; type=&quot;text&quot; \/&gt;&lt;\/td&gt;\r\n&lt;\/tr&gt;\r\n&lt;\/tbody&gt;\r\n&lt;\/table&gt;\r\n&lt;div&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;\u9001\u4fe1&quot; \/&gt;&lt;\/div&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/23b744f554c4a7734c51bf205ee8d20d.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2013-03-31 3.10.51\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/23b744f554c4a7734c51bf205ee8d20d.png\" width=\"573\" height=\"123\" \/><\/a><\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u304c\u4e00\u756a\u6700\u521d\u306b\u4eeeID\u3092\u767a\u884c\u3059\u308b\u305f\u3081\u306b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u307f\u3092\u767b\u9332\u3067\u304d\u308b\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u767b\u9332\u7528\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u7528\u610f\u81f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>email_regist.php\uff1a\u30e6\u30fc\u30b6\u306e\u4eee\u767b\u9332\u3068\u767b\u9332\u30da\u30fc\u30b8URL\u306e\u9001\u4fe1\u7528\u30d5\u30a1\u30a4\u30eb<\/strong>\u3067\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001input type=&#8221;hidden&#8221;\u306evalue\u306b\u306femail_regist\u306e\u5024\u3092\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001mode\u306b\u3088\u308b\u5207\u308a\u66ff\u3048\u3092\u884c\u3044\u307e\u3059\u306e\u3067\u3001<strong>input type=&#8221;hidden&#8221;\u306ename\u306f mode<\/strong>\u3001<strong>form \u306e action\u306findex.php<\/strong>\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h4>email_regist.php\uff1a\u30e6\u30fc\u30b6\u306e\u4eee\u767b\u9332\u3068\u767b\u9332\u30da\u30fc\u30b8URL\u306e\u9001\u4fe1\u7528\u30d5\u30a1\u30a4\u30eb<\/h4>\n<p>\u7d9a\u3044\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u4eee\u767b\u9332\u306e\u70ba\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3063\u305f\u5f8c\u306e\u51e6\u7406\u3092\u884c\u3046\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;!--?php \r\n\/* \u30d5\u30a9\u30fc\u30e0\u304b\u3089\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97 *\/\r\n$email = $_POST&#x5B;&quot;email&quot;];\r\n\r\n\/* \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u914d\u5217 *\/\r\n$error = array();\r\n\r\n\/* \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a *\/\r\nrequire_once(&quot;db.php&quot;);\r\n\r\n\/* \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5165\u529b\u30c1\u30a7\u30c3\u30af *\/\r\nif($email == &quot;&quot;) { \/\/\u672a\u5165\u529b\u306e\u5834\u5408\u3001\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\r\n  \/\/\u30a8\u30e9\u30fc\u914d\u5217\u306b\u5024\u3092\u4ee3\u5165\t\r\n  array_push($error, &quot;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;); \/\/\u30a8\u30e9\u30fc\u914d\u5217\u306b\u5024\u3092\u4ee3\u5165\r\n} else {\r\n \/\/\u4eee\u30e6\u30fc\u30b6\u30fcID\u306e\u751f\u6210\r\n $pre_user_id = uniqid(rand(100,999));\r\n\r\n \/\/SQL\u6587\u3092\u767a\u884c\r\n $query = &quot;insert into members(pre_userid,email) values('$pre_user_id','$email')&quot;;\r\n $result = mysql_query($query);\r\n\r\n \/* \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u767b\u9332\u30c1\u30a7\u30c3\u30af *\/\r\n if($result == false) {\r\n   array_push($error, &quot;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002&quot;); \/\/\u30a8\u30e9\u30fc\u914d\u5217\u306b\u5024\u3092\u4ee3\u5165\r\n } else {\r\n\r\n   \/* \u53d6\u5f97\u3057\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5b9b\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1 *\/\r\n   mb_language(&quot;japanese&quot;);\r\n   mb_internal_encoding(&quot;utf-8&quot;);\r\n\r\n   $to = $email;\r\n   $subject = &quot;\u4f1a\u54e1\u767b\u9332URL\u9001\u4fe1\u30e1\u30fc\u30eb&quot;;\r\n   $message = &quot;\u4ee5\u4e0b\u306eURL\u3088\u308a\u4f1a\u54e1\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n&quot;.\r\n   &quot;http:\/\/localhost:8888\/member_test\/regist\/index.php?pre_userid=$pre_user_id&quot;;\r\n   $header = &quot;From:test@test.com&quot;;\r\n\r\n   if(!mb_send_mail($to, $subject, $message, $header)) {  \/\/\u30e1\u30fc\u30eb\u9001\u4fe1\u306b\u5931\u6557\u3057\u305f\u3089\r\n     array_push($error,&quot;\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\r\n&lt;a href='http:\/\/localhost:8888\/member_test\/regist\/index.php?pre_userid=$pre_user_id'&gt;\u9077\u79fb\u5148&lt;\/a&gt;&quot;); \/\/\u30a8\u30e9\u30fc\u914d\u5217\u306b\u5024\u3092\u4ee3\u5165\t\r\n    }\r\n  }\r\n}\r\n\r\n\/*\u30a8\u30e9\u30fc\u304c\u3042\u308b\u304b\u306a\u3044\u304b\u306b\u3088\u3063\u3066\u8868\u793a\u306e\u632f\u308a\u5206\u3051($error\u914d\u5217\u306e\u78ba\u8a8d\uff09*\/\r\nif(count($error) &gt; 0) {  \/\/\u30a8\u30e9\u30fc\u304c\u3042\u3063\u305f\u5834\u5408\r\n  \/*\u30a8\u30e9\u30fc\u5185\u5bb9\u8868\u793a*\/\r\n  foreach($error as $value) {\r\n?--&gt;\r\n&lt;table&gt;&lt;caption&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u767b\u9332\u30a8\u30e9\u30fc&lt;\/caption&gt;\r\n&lt;tbody&gt;\r\n&lt;tr&gt;\r\n&lt;td class=&quot;item&quot;&gt;Error\uff1a&lt;\/td&gt;\r\n&lt;td&gt;&lt;\/td&gt;\r\n&lt;\/tr&gt;\r\n&lt;\/tbody&gt;\r\n&lt;\/table&gt;\r\n&lt;!--?php } \/\/foreach\u6587\u306e\u7d42\u4e86 } else { \/\/\u30a8\u30e9\u30fc\u304c\u306a\u304b\u3063\u305f\u5834\u5408 ?--&gt;&lt;\/pre&gt;\r\n&lt;table&gt;&lt;caption&gt;\u30e1\u30fc\u30eb\u9001\u4fe1\u6210\u529f\u3057\u307e\u3057\u305f\u3002&lt;\/caption&gt;\r\n&lt;tbody&gt;\r\n&lt;tr&gt;\r\n&lt;td class=&quot;item&quot;&gt;\u9001\u4fe1\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff1a&lt;\/td&gt;\r\n&lt;td&gt;&lt;\/td&gt;\r\n&lt;\/tr&gt;\r\n&lt;\/tbody&gt;\r\n&lt;\/table&gt;\r\n&lt;!--?php } ?--&gt;<\/pre>\n<p>\u305d\u308c\u3067\u306f\u89e3\u8aac\u3092\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$email = $_POST&#x5B;\"email\"];<\/pre>\n<p>\u307e\u305a\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u5165\u529b\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092<strong> $email = $_POST[&#8220;email&#8221;];<\/strong> \u3067\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$error = array();<\/pre>\n<p>\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u914d\u5217\u7528\u3068\u3057\u3066\u3001 <strong>$error = array();<\/strong> \u3092\u7528\u610f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">require_once(\"db.php\");<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u306e\u70ba\u3001<strong>require_once();<\/strong>\u3067\u63a5\u7d9a\u3002\u7d9a\u3044\u3066\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5165\u529b\u30c1\u30a7\u30c3\u30af\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if($email == \"\") {\u00a0\r\n  array_push($error, \"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\r\n}<\/pre>\n<p>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u7a7a\u3060\u3063\u305f\u5834\u5408 <strong>\u00a0if($email == &#8220;&#8221;)<\/strong> \u30a8\u30e9\u30fc\u914d\u5217\u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u5165\u529b\u3055\u308c\u3066\u3044\u305f\u3089\u3001\u4eee\u30e6\u30fc\u30b6\u30fcID\u306e\u767b\u9332\u306e\u51e6\u7406\u3078\u3068\u79fb\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h5>\u4eee\u30e6\u30fc\u30b6\u30fcID\u306e\u767a\u884c\u51e6\u7406<\/h5>\n<p>\u307e\u305a\u3001\u4eee\u30e6\u30fc\u30b6\u30fcid\u306e\u5909\u6570\u3092<strong>$pre_user_id<\/strong>\u3068\u3057\u3066\u3001\u4eee\u30e6\u30fc\u30b6\u30fcID\u306e\u767a\u884c\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><strong>PHP\u306euniqid\u95a2\u6570\u3067\u30e6\u30cb\u30fc\u30afID\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/strong>uniqid\u95a2\u6570\u306f$prefix(\u63a5\u982d\u8f9e)\u306a\u3057\u3067\u5229\u7528\u3059\u308b\u3068\uff0c13\u6587\u5b57\u306e\u6587\u5b57\u5217\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002uniqid\u95a2\u6570\u306f\u30de\u30a4\u30af\u30ed\u79d2\u5358\u4f4d\u3067\u5909\u5316\u3059\u308b\u30e6\u30cb\u30fc\u30afID\u306a\u306e\u3067\uff0c\u540c\u3058\u30de\u30a4\u30af\u30ed\u79d2\u3067\u3042\u308c\u3070\u540c\u3058ID\u304c\u751f\u6210\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u3001rand\u95a2\u6570\u3092\u4f7f\u3044\u4e71\u6570\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u7b2c\u4e00\u5f15\u6570\u306b100\u3001\u7b2c\u4e8c\u5f15\u6570\u306b999\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067100~999\u306e\u4e71\u6570\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$pre_user_id = uniqid(rand(100,999));<\/pre>\n<p>\u7d9a\u3044\u3066\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u5165\u308c\u308b\u305f\u3081\u306eSQL\u6587\u3092\u767a\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$query = \"insert into members(pre_userid, email) values('$pre_user_id','$email')\";\r\n$result = mysql_query($query);<\/pre>\n<p>$query\u306bSQL\u6587\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002insert into members(pre_userid, email) \u3067\u7528\u610f\u3057\u305fmembers\u306e\u30c6\u30fc\u30d6\u30eb\u306epre_userid\u3068email\u306e\u30ab\u30e9\u30e0\u306b\u4ee3\u5165\u3002\u4ee3\u5165\u3059\u308b\u5024\u306fpost\u3067\u53d7\u3051\u53d6\u3063\u305f\u3001$pre_user_id\u3068$email\u3068\u306a\u308b\u305f\u3081\u3001values\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 values(&#8216;$pre_user_id&#8217;,&#8217;$email&#8217;)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$result = mysql_query($query);<\/pre>\n<p>MySQL \u30af\u30a8\u30ea\u3092\u9001\u4fe1\u51fa\u6765\u308b\u3088\u3046\u306bmysql_query\u95a2\u6570\u3092\u4f7f\u3044\u5148\u7a0b\u306eSQL\u6587\u3092\u4ee3\u5165\u3002\u305d\u308c\u3089\u3092\u5909\u6570 $result\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002\u305d\u308c\u3089\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u306e\u51e6\u7406\u3092 if($result == false) \u3067\u5224\u5b9a\u3057\u307e\u3059\u3002\u767b\u9332\u3055\u308c\u306a\u304b\u3063\u305f\u5834\u5408\u3001array_push($error, &#8220;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002&#8221;);\u3067\u30a8\u30e9\u30fc\u914d\u5217 $error\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<h5>\u30e1\u30fc\u30eb\u9001\u4fe1<\/h5>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3055\u308c\u305f\u3089\u30e1\u30fc\u30eb\u306e\u914d\u4fe1\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mb_language(\"japanese\"); \/\/\u8a00\u8a9e\u306e\u8a2d\u5b9a\r\nmb_internal_encoding(\"utf-8\"); \/\/\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\r\n\r\n$to = $email;\r\n$subject = \"\u4f1a\u54e1\u767b\u9332URL\u9001\u4fe1\u30e1\u30fc\u30eb\";\r\n$message = \"\u4ee5\u4e0b\u306eURL\u3088\u308a\u4f1a\u54e1\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n\".\r\n\"http:\/\/localhost:8888\/member_test\/regist\/index.php?pre_userid=$pre_user_id\";\r\n$header = \"From:test@test.com\";\r\n<\/pre>\n<p>\u4eca\u56de\u306fMAMP\u3092\u4f7f\u3044\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u74b0\u5883\u3067\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u74b0\u5883\u306b\u3042\u3063\u305f\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u4e0b\u3055\u3044\u3002 <strong>mb_language(&#8220;japanese&#8221;);<\/strong> \u3067\u65e5\u672c\u8a9e\u306e\u8a2d\u5b9a\u3001<strong>mb_internal_encoding(&#8220;utf-8&#8221;);<\/strong> \u3067\u6587\u5b57\u5316\u3051\u3057\u306a\u3044\u3088\u3046\u306b\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3002\u4eca\u56de\u306futf-8\u3067\u4f5c\u6210\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>$to \u306b\u9001\u4fe1\u5148\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/strong>\u5148\u307b\u3069post\u3067\u53d7\u3051\u53d6\u3063\u305f $email\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>$subject = &#8220;\u4f1a\u54e1\u767b\u9332URL\u9001\u4fe1\u30e1\u30fc\u30eb&#8221;;<\/strong> \u306f\u30e1\u30fc\u30eb\u306e\u4ef6\u540d\u3068\u306a\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>$message = &#8220;\u4ee5\u4e0b\u306eURL\u3088\u308a\u4f1a\u54e1\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n&#8221;.&#8221;http:\/\/localhost:8888\/member_test\/regist\/index.php?pre_userid=$pre_user_id&#8221;;<\/strong> \u306f\u30e1\u30fc\u30eb\u306e\u6587\u3068\u306a\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>url\u306b\u95a2\u3057\u3066\u306f\u5b9f\u969b\u306e\u74b0\u5883\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>?pre_userid=$pre_user_id<\/strong> \u306furl\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>GET\u3067\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3053\u308c\u306b\u3088\u3063\u3066mode\u306e\u5207\u308a\u66ff\u3048\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>$pre_user_id\u306e\u5024\u306f\u5148\u307b\u3069uniqid\u95a2\u6570\u3067\u751f\u6210\u3057\u305f\u30e6\u30cb\u30fc\u30afID\u306e\u5024\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>$header = &#8220;From:test@test.com&#8221;;<\/strong> \u306f\u30e1\u30fc\u30eb\u306e\u5dee\u3057\u51fa\u3057\u4eba\u3068\u306a\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u3092 mb_send_mail\u95a2\u6570\u3067\u30e1\u30fc\u30eb\u914d\u4fe1\u3057\u307e\u3059\u3002<strong>mb_send_mail(\u9001\u4fe1\u5148, \u4ef6\u540d, \u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u5bb9, \u30d8\u30c3\u30c0\u30fc\uff08\u5dee\u3057\u51fa\u3057\u4eba\uff09)<\/strong> \u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002\u914d\u4fe1\u3068\u540c\u6642\u306b\u914d\u4fe1\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u3001<strong>if(!mb_send_mail($to, $subject, $message, $header)) {<\/strong>\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u624b\u304f\u3044\u304f\u3068\u4ee5\u4e0b\u306e\u69d8\u306b\u914d\u4fe1\u3055\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mail.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4473\" title=\"mail\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mail.jpg\" alt=\"\" width=\"477\" height=\"177\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mail.jpg 477w, https:\/\/www.webcyou.com\/wp-content\/uploads\/mail-300x111.jpg 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/a><\/p>\n<p>\u6700\u521d\u306f\u30e1\u30fc\u30eb\u304c\u914d\u4fe1\u3055\u308c\u305f\u3060\u3051\u3067\u611f\u52d5\u3057\u3066\u3044\u305f\u3082\u3093\u3067\u3059\u3002\u3046\u3093\u3046\u3093\u3002<\/p>\n<p>\u914d\u4fe1\u3055\u308c\u306a\u304b\u3063\u305f\u3068\u304d\u306e\u51e6\u7406\u3068\u3057\u3066\u3001\u4f8b\u306e\u5982\u304f\u3001<strong>array_push($error,&#8221;\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u301c\uff08\u7701\u7565\uff09\u301c&#8221;);<\/strong> \u3067$error\u3067\u30a8\u30e9\u30fc\u3092\u683c\u7d0d\u3001\u305d\u306e\u5f8c\u306eview\u90e8\u5206\u3068\u3057\u3066 <strong>if(count($error) &gt; 0) {<\/strong> \u3067\u30a8\u30e9\u30fc\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3001 <strong>foreach($error as $value) {<\/strong> \u3067\u30a8\u30e9\u30fc\u306e\u6570\u3060\u3051\u30eb\u30fc\u30d7\u3055\u305b\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u3042\u308b\u5834\u5408\u306f <strong>print $value;<\/strong>\u3067\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3002<\/p>\n<p>\u306a\u3044\u5834\u5408\u306f\u3001\u9001\u4fe1\u6210\u529f\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3068 <strong>print $email<\/strong> \u3067\u9001\u4fe1\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8868\u793a\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3068\u3053\u3053\u307e\u3067\u304c\u3001<strong>email_regist.php<\/strong>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5168\u90e8\u66f8\u3053\u3046\u3068\u601d\u3063\u3066\u304a\u308a\u307e\u3057\u305f\u304c\u3001\u7d50\u69cb\u9577\u304f\u306a\u308a\u305d\u3046\u306a\u306e\u3067\u4f55\u56de\u304b\u306b\u5206\u3051\u3066\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4ee5\u4e0a\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7d9a\u304d\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><a href=\"https:\/\/www.webcyou.com\/?p=4491\">PHP \u4f1a\u54e1\u5236\u30b5\u30a4\u30c8\u306e\u5236\u4f5c\u65b9\u6cd5 \u305d\u306e2<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 \u4eca\u56de\u306f\u6c17\u5206\u3092\u5909\u3048\u3066\u4f1a\u54e1\u5236\u306e\u30b5\u30a4\u30c8\u5236\u4f5c\u65b9\u6cd5\u3092\u3002 \u3068\u8a00\u3063\u3066\u3082\u57fa\u790e\u7684\u306a\u90e8\u5206\u3068\u306a\u308a\u307e\u3059\u304c\u3002 \u30b4\u30ea\u30b4\u30ea\u66f8\u3044\u3066\u3044\u308b\u30a8\u30f3\u30b8\u30cb\u30a2\u3055\u3093\u306a\u3089\u3042\u308c\u3067\u3059\u304c\u3001\u3084\u3063\u3071\u66f8\u3044\u3066\u3044\u306a\u3044\u3068\u5fd8\u308c\u308b\u306e\u304c\u4eba\u9593\u3060\u3063\u305f\u308a\u3082\u3059\u308b\u306e\u3067\u3001\u601d\u3044\u51fa\u3059\u306e\u3082\u542b\u3081\u3066\u66f8\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[168,176,107,180,173,44,45,111],"class_list":{"0":"post-4455","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-php","7":"tag-html","8":"tag-html5","9":"tag-mamp","10":"tag-mysql","11":"tag-php","12":"tag-web","14":"tag-wordpress-2"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4455"}],"version-history":[{"count":28,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4455\/revisions"}],"predecessor-version":[{"id":10787,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4455\/revisions\/10787"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}