{"id":4501,"date":"2013-04-01T13:05:36","date_gmt":"2013-04-01T04:05:36","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=4501"},"modified":"2021-03-03T11:08:06","modified_gmt":"2021-03-03T02:08:06","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-%e3%81%9d%e3%81%ae3","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=4501","title":{"rendered":"PHP \u4f1a\u54e1\u5236\u30b5\u30a4\u30c8\u306e\u5236\u4f5c\u65b9\u6cd5 \u305d\u306e3"},"content":{"rendered":"<p>\u524d\u56de\u306e<\/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<p>\u306e\u7d9a\u304d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<\/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>\u306e2\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u5b8c\u6210\u3055\u305b\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>user_regist.php\uff1a\u4f1a\u54e1\u767b\u9332\u3068\u767b\u9332\u5185\u5bb9\u9001\u4fe1\u30d5\u30a1\u30a4\u30eb<\/h4>\n<p>\u524d\u56de\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u00a0<strong>regist_confirm.php\uff1a\u4f1a\u54e1\u767b\u9332\u5185\u5bb9\u78ba\u8a8d\u753b\u9762\u30d5\u30a1\u30a4\u30eb<\/strong>\u306e\u5f8c\u306e\u51e6\u7406\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u767b\u9332\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u305f\u3042\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5404\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u767b\u9332\u3057\u3001\u767b\u9332\u5b8c\u4e86\u306e\u30e1\u30fc\u30eb\u3092\u914d\u4fe1\u3059\u308b\u6d41\u308c\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n\/* \u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u5f97 *\/\r\n$formList = array('mode', 'input_userid', 'input_password', 'input_name', 'input_email');\r\n\r\n\/* \u30dd\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u540c\u540d\u306e\u5909\u6570\u306b\u683c\u7d0d *\/\r\nforeach($formList as $value) {\r\n  $$value = $_POST&#x5B;$value];\r\n}\r\n\r\n\/* \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u521d\u671f\u5316 *\/\r\n$error = array();\r\n\r\n\/* \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u8a2d\u5b9a *\/\r\nrequire_once('db.php');\r\n\r\n\/* \u30e6\u30fc\u30b6\u30fcID\u30c1\u30a7\u30c3\u30af *\/\r\n$query = &quot;select userid from members where userid = '$input_userid'&quot;; \r\n$resultId = mysql_query($query);\r\n\t\r\nif(mysql_num_rows($resultId) &gt; 0 ) { \/\/\u30e6\u30fc\u30b6\u30fcID\u304c\u5b58\u5728\r\n  array_push($error,&quot;\u3053\u306e\u30e6\u30fc\u30b6\u30fcID\u306f\u3059\u3067\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002&quot;);\r\n}\r\n\t\r\nif(count($error) == 0) {\r\n  \r\n  \/\/\u767b\u9332\u3059\u308b\u30c7\u30fc\u30bf\u30fc\u306b\u30a8\u30e9\u30fc\u304c\u306a\u3044\u5834\u5408\u3001member\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u3002\r\n  \/\/\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u958b\u59cb\r\n  mysql_query(&quot;begin&quot;);\r\n  \r\n  $query = &quot;insert into members(userid, password, name, email) values('$input_userid','$input_password','$input_name','$input_email')&quot;;\r\n  $result = mysql_query($query);\r\n  \r\n  if($result){  \/\/\u767b\u9332\u5b8c\u4e86\t\r\n    \/\/\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7d42\u308f\u308a\r\n    mysql_query(&quot;commit&quot;);\r\n  \r\n    \/* \u767b\u9332\u5b8c\u4e86\u30e1\u30fc\u30eb\u3092\u9001\u4fe1 *\/\r\n    mb_language(&quot;japanese&quot;);  \/\/\u8a00\u8a9e\u306e\u8a2d\u5b9a\r\n    mb_internal_encoding(&quot;utf-8&quot;);\/\/\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\r\n  \r\n    $to = $input_email;\r\n    $subject = &quot;\u4f1a\u54e1\u767b\u9332URL\u9001\u4fe1\u30e1\u30fc\u30eb&quot;;\r\n    $message = &quot;\u4f1a\u54e1\u767b\u9332\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002\\n&quot;.&quot;\u767b\u9332\u3044\u305f\u3060\u3044\u305f\u30e6\u30fc\u30b6\u30fcID\u306f&#x5B;$input_userid]\u3067\u3059\u3002&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&lt;br&gt;\u305f\u3060\u3057\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u767b\u9332\u306f\u5b8c\u4e86\u3057\u3066\u3044\u307e\u3059\u3002&quot;);\r\n    }\r\n  } else {\t\/\/\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u767b\u9332\u4f5c\u696d\u5931\u6557\r\n    \/\/\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\r\n    mysql_query(&quot;rollback&quot;);\t\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;);\r\n  }\r\n}\r\nif(count($error) == 0) {\t\r\n?&gt;\r\n&lt;table&gt;\r\n  &lt;caption&gt;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u767b\u9332\u5b8c\u4e86&lt;\/caption&gt;\r\n  &lt;tr&gt;\r\n    &lt;td class=&quot;item&quot;&gt;Thanks\uff1a&lt;\/td&gt;\r\n    &lt;td&gt;\u767b\u9332\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002&lt;br&gt;\u767b\u9332\u5b8c\u4e86\u306e\u304a\u77e5\u3089\u305b\u3092\u30e1\u30fc\u30eb\u3067\u9001\u4fe1\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n&lt;?php\r\n\/* \u30a8\u30e9\u30fc\u5185\u5bb9\u8868\u793a *\/\r\n} else {\r\n?&gt;\r\n&lt;table&gt;\r\n  &lt;caption&gt;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u767b\u9332\u30a8\u30e9\u30fc&lt;\/caption&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;\r\n  &lt;?php\r\n  foreach($error as $value) {\r\n    print $value;\r\n  ?&gt;\r\n  &lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n&lt;?php\r\n  }\r\n}\r\n?&gt;\r\n<\/pre>\n<p>\u3067\u306f\u305d\u308c\u305e\u308c\u89e3\u8aac\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><strong>regist_confirm.php\u00a0<\/strong>\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u30dd\u30b9\u30c8\u3067\u53d7\u3051\u53d6\u308b\u70ba\u306b\u5909\u6570$formList\u306b\u914d\u5217\u3067\u683c\u7d0d\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$formList = array('mode','pre_userid','input_userid','input_password','input_name','input_email');<\/pre>\n<p><strong>regist_confirm.php\u00a0<\/strong>\u540c\u69d8\u3001\u5909\u6570$formList\u306b\u683c\u7d0d\u3057\u305f\u9023\u60f3\u914d\u5217\u3092\u305d\u306e\u307e\u307e$\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3001\u5909\u6570\u3068\u540c\u540d\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092POST\u3067\u53d7\u3051\u53d6\u308a\u3001\u540c\u540d\u306e\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">foreach($formList as $value) {\r\n  $$value = $_POST&#x5B;$value];\r\n}<\/pre>\n<p><strong>regist_confirm.php\u00a0<\/strong>\u540c\u69d8\u3001\u30a8\u30e9\u30fc\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$error = array();<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">require_once('db.php');<\/pre>\n<p>\u30e6\u30fc\u30b6\u30fcID\u304c\u91cd\u8907\u3057\u3066\u3044\u306a\u3044\u304b\u8abf\u3079\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fcID\u304c\u3059\u3067\u306b\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u30a8\u30e9\u30fc\u5909\u6570$error\u306b\u30a8\u30e9\u30fc\u6587\u8a00\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$query = &quot;select userid from members where userid = '$input_userid'&quot;; \r\n$resultId = mysql_query($query);\r\nif(mysql_num_rows($resultId) &gt; 0 ) {\u00a0\r\n  array_push($error,&quot;\u3053\u306e\u30e6\u30fc\u30b6\u30fcID\u306f\u3059\u3067\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002&quot;);\r\n}<\/pre>\n<p>\u30a8\u30e9\u30fc\u304c\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u51e6\u7406\u3078\u3068\u79fb\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mysql_query(\"begin\");<\/pre>\n<p>\u3053\u3053\u304b\u3089\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u958b\u59cb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3068\u306f\u3001\u8907\u6570\u306e\u51e6\u7406\u304c\u3042\u308b\u5834\u5408\u3001\u300c\u3059\u3079\u3066\u306e\u51e6\u7406\u304c\u6210\u529f\u3057\u305f\u3068\u304d\u306b\u306e\u307f\u6210\u529f\u300d\u3068\u306a\u308a\u3001\u4e00\u3064\u3067\u3082\u5931\u6557\u304c\u767a\u751f\u3059\u308b\u3068\u300c\u5168\u3066\u5931\u6557\u300d\u3068\u3059\u308b\u3053\u3068\u3092\u8a00\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u51e6\u7406\u304c\u5fc5\u8981\u306a\u5834\u9762\u306f\u9280\u884c\u306e\u632f\u8fbc\u307f\u306e\u51e6\u7406\u306a\u3069\u306b\u3082\u8a72\u5f53\u3057\u307e\u3059\u3002<\/p>\n<p>A\u3055\u3093\u304cB\u3055\u3093\u306b10\u4e07\u632f\u308a\u8fbc\u3093\u3060\u969b\u3001A\u3055\u3093\u306e\u9810\u91d1\u304b\u308910\u4e07\u306e\u9001\u91d1\u306f\u3055\u308c\u305f\u304c\u3001B\u3055\u3093\u306e\u9810\u91d1\u306b\u4e0d\u5177\u5408\u304c\u751f\u3058\u3001\u632f\u308a\u8fbc\u307e\u308c\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>\u3053\u306e\u6642\u3001A\u3055\u3093\u306e\u51e6\u7406\u3092\u6210\u529f\u3068\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u4e0d\u6574\u5408\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u305f\u3081\u3001B\u3055\u3093\u306e\u9810\u91d1\u306b\u5165\u308b\u307e\u3067\u306e\u51e6\u7406\u3092\u6210\u529f\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u5834\u5408\u3060\u3068\u3001\u8907\u6570\u30ab\u30e9\u30e0\u306b\u4ee3\u5165\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5168\u3066\u683c\u7d0d\u3055\u308c\u305f\u3068\u304d\u306e\u307f\u6210\u529f\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$query = \"insert into members(userid, password, name, email) values('$input_userid','$input_password','$input_name','$input_email')\";\r\n$result = mysql_query($query);<\/pre>\n<p>\u305d\u306e\u5f8c\u306e\u30e1\u30fc\u30eb\u914d\u4fe1\u306e\u51e6\u7406\u306fPHP \u4f1a\u54e1\u5236\u30b5\u30a4\u30c8\u306e\u5236\u4f5c\u65b9\u6cd5\u00a0\uff11\u56de\u76ee\u540c\u69d8\u3068\u306a\u308a\u307e\u3059\u3002\uff08\u6587\u8a00\u7b49\u306f\u7570\u306a\u308a\u307e\u3059\u3002\uff09<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mysql_query(\"rollback\");<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u5931\u6557\u3057\u305f\u969b\u306f\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u306e\u51e6\u7406\u3092\u884c\u3044\u3001\u30a8\u30e9\u30fc\u5909\u6570\u00a0$error\u306b\u30a8\u30e9\u30fc\u6587\u8a00\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if(count($error) == 0) { <\/pre>\n<p>\u305d\u306e\u5f8c\u306f\u3001\u30a8\u30e9\u30fc\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u30a8\u30e9\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u767b\u9332\u5b8c\u4e86\u306e\u6587\u8a00\u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">foreach($error as $value) {\r\n  print $value;<\/pre>\n<p>foreach\u3067\u30a8\u30e9\u30fc\u306e\u6570\u3060\u3051\u30eb\u30fc\u30d7\u3057\u3001\u8868\u793a\u3055\u305b\u307e\u3059\u3002<\/p>\n<h4>index.php\uff1a\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u51e6\u7406\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30da\u30fc\u30b8<\/h4>\n<p>\u3068\u3001\u4e00\u901a\u308a\u306e\u51e6\u7406\u306f\u5b8c\u6210\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u30da\u30fc\u30b8 index.php\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n\/* \u767b\u9332\u51e6\u7406\uff08\u7d42\u4e86\u3092\u77e5\u3089\u305b\u308b\u5024\uff09\u306b\u3088\u3063\u3066\u8aad\u307f\u8fbc\u3080\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u3048\u308b *\/\r\n$mode = $_POST&#x5B;&quot;mode&quot;];\r\n\r\n\/* \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u3000preuser_id\u304c\u3042\u308c\u3070\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a *\/\r\nif($_GET&#x5B;'pre_userid'] !=&quot;&quot;) {\r\n  $mode = &quot;regist_form&quot;;\r\n}\r\n\r\n\/* \u632f\u308a\u5206\u3051\u51e6\u7406 *\/\r\nswitch($mode) {\r\n  \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u767b\u9332\u3068\u4eeeID\u9001\u4fe1\r\n  case&quot;email_regist&quot;:\r\n  $module = &quot;email_regist.php&quot;;\r\n  break;\r\n\r\n  \/\/\u4f1a\u54e1\u767b\u9332\u30d5\u30a9\u30fc\u30e0\r\n  case&quot;regist_form&quot;:\r\n  $module = &quot;regist_form.php&quot;;\r\n  break;\r\n\r\n  \/\/\u767b\u9332\u5185\u5bb9\u78ba\u8a8d\r\n  case&quot;regist_confirm&quot;:\r\n  $module = &quot;regist_confirm.php&quot;;\r\n  break;\r\n\t\r\n  \/\/\u4f1a\u54e1\u767b\u9332\r\n  case&quot;user_regist&quot;:\r\n  $module = &quot;user_regist.php&quot;;\r\n  break;\r\n\t\r\n  \/\/\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u767b\u9332\uff08\u521d\u671f\u753b\u9762\uff09\r\n  default:\r\n  $module = &quot;email_form.php&quot;;\r\n  break;\r\n}\r\n?&gt;\r\n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt;\r\n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot; \/&gt;\r\n&lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;..\/css\/style.css&quot;\/&gt;\r\n&lt;title&gt;\u4f1a\u54e1\u767b\u9332\u30d5\u30a9\u30fc\u30e0&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;?php\r\n  \/\/ \u30b3\u30f3\u30c6\u30f3\u30c4\uff08\u8868\u793a\u30da\u30fc\u30b8\uff09\u8aad\u307f\u8fbc\u307f\r\n  require_once($module);\r\n?&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u305d\u308c\u3067\u306f\u89e3\u8aac\u3092\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$mode = $_POST&#x5B;\"mode\"];<\/pre>\n<p>\u30d5\u30a9\u30fc\u30e0\u3092\u62bc\u3057\u305f\u969b\u306bPOST\u3067\u30d1\u30e9\u30e1\u30fc\u30bfmode\u3092\u6e21\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53d7\u3051\u53d6\u3063\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u3092$mode\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if($_GET&#x5B;'pre_userid'] !=\"\") {\r\n  $mode = \"regist_form\";\r\n}\r\n<\/pre>\n<p>\u3053\u3061\u3089\u306fGET\u3067pre_userid\u3092\u53d7\u3051\u53d6\u3063\u305f\u969b\u306e\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<\/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<p>\u306e\u6642\u306e\u51e6\u7406\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u767b\u9332\u3057\u3001\u4eeeID\u3092\u767a\u884c\u3057\u305f\u30e1\u30fc\u30eb\u306eURL\u3092\u958b\u3044\u305f\u3068\u304d\u306e\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u6642\u306f\u3001\u672c\u767b\u9332\u306e\u51e6\u7406\u3092\u884c\u3046\u306e\u3067\u3001mode\u306fregist?form\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$mode = \"regist_form\";<\/pre>\n<p>switch\u6587\u3092\u4f7f\u3044\u3001mode\u306b\u3088\u308b\u5207\u308a\u66ff\u3048\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">switch($mode) {<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">case\"email_regist\":\r\n  $module = \"email_regist.php\";\r\n  break;<\/pre>\n<p>mode\u304cemail_regist\u3067\u3042\u308c\u3070\u3001email_regist.php\u3068\u5404mode\u306b\u5bfe\u3057\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u6570$module\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">require_once($module);<\/pre>\n<p>\u8868\u793a\u3059\u308b\u306e\u306f\u3001switch\u6587\u3092\u4f7f\u3044\u3001\u5404mode\u306b\u5bfe\u3057\u3066\u4ee3\u5165\u3057\u305f$module\u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u4f1a\u54e1\u306e\u51e6\u7406\u3068\u3057\u3066\u4e00\u901a\u308a\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h4>login.php\uff1a\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8<\/h4>\n<p>\u6700\u5f8c\u306b\u3001\uff08\u3061\u3087\u3063\u3068\u5fd8\u308c\u3066\u304a\u308a\u307e\u3057\u305f\u3002\uff09\u4f1a\u54e1\u767b\u9332\u5f8c\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u30da\u30fc\u30b8\u306e\u4f5c\u6210\u3092\u3002\u30bd\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n\/\/\u30bb\u30c3\u30b7\u30e7\u30f3\u4f5c\u6210\r\nsession_start();\r\n\r\nif(!isset($_POST&#x5B;'login'])) {\r\n  \/\/\u30ed\u30b0\u30a4\u30f3\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a\r\n  inputForm();\r\n} else {\r\n\r\n  \/\/\u30d5\u30a9\u30fc\u30e0\u306e\u5024\u3092\u53d6\u5f97\r\n  $formUserId = $_POST&#x5B;'formUserid'];\r\n  $formPassword = $_POST&#x5B;'formPassword'];\r\n\t\r\n  \/\/ID, PASWORD\u304c\u672a\u5165\u529b\u306e\u5834\u5408\r\n  if(($formUserId == &quot;&quot;) || ($formPassword == &quot;&quot;)) {\r\n\t\r\n  \/\/\u30a8\u30e9\u30fc\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\r\n  error(1);\r\n\t\t\r\n  } else { \r\n  \/\/ID,PASSWORD \u5165\u529b\u30a2\u30ea\t\r\n  \/\/\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u63a5\u7d9a\r\n  require_once('regist\/db.php');\r\n\t\t\t\t\r\n  \/\/member\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\r\n  $query = &quot;select * from members&quot;;\r\n  $result = mysql_query($query);\r\n\t\t\r\n  \/\/\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53d6\u5f97\u3057\u305fUSERID\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306eUSERID\u304c\u4e00\u81f4\u3057\u305f\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306ePASSWORD\u3092\u5909\u6570\u306b\u683c\u7d0d\t\t\r\n  while($data = mysql_fetch_array($result)) {\r\n    if($data&#x5B;'userid'] == $formUserId) {  \/\/\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53d6\u5f97\u3057\u305fUSERID\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eUSERID\u304c\u4e00\u81f4\r\n      $dbPassword = $data&#x5B;'password'];\r\n      break;\r\n    }\r\n  }\r\n\t\r\n  \/\/MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9589\u3058\u308b\r\n  mysql_close($conn);\r\n  \r\n  \/\/$dbPassword\u3068\u3044\u3046\u5909\u6570\u306b\u5024\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u2192formUserId\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eID\u304c\u4e0d\u4e00\u81f4\r\n  if(!isset($dbPassword)) {\r\n    error(2);\r\n  } else {\r\n  \/\/formUserId\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eID\u304c\u4e00\u81f4\r\n  \/\/\u30d5\u30a9\u30fc\u30e0\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e0d\u4e00\u81f4\r\n    if($dbPassword != $formPassword){\r\n\t  error(3);\r\n\t} else {\r\n\t  \/\/ID,\u30d1\u30b9\u30ef\u30fc\u30c9\u3069\u3061\u3089\u3082\u4e00\u81f4\r\n\t  \/\/\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u3092\u4f5c\u6210\u2192\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306b\u3000$formUserID \u3092\u767b\u9332\r\n\t  $_SESSION&#x5B;'loginUser'] = $formUserId;\r\n\t  header(&quot;Location:test.php&quot;);\r\n\t  }\r\n\t}\r\n  }\r\n}\r\n?&gt;\r\n&lt;?php\r\n  \/\/\u5165\u529b\u753b\u9762\u8868\u793a\u753b\u9762\t\r\n  function inputForm() {\r\n?&gt;\r\n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt;\r\n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot; \/&gt;\r\n&lt;title&gt;\u30ed\u30b0\u30a4\u30f3&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;h1&gt;\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8&lt;\/h1&gt;\r\n  &lt;form action=&quot;login.php&quot; method=&quot;post&quot;&gt;\r\n  &lt;label for=&quot;userid&quot;&gt;\u30e6\u30fc\u30b6\u30fcID&lt;\/label&gt;\uff1a\r\n  &lt;input type=&quot;text&quot; name=&quot;formUserid&quot; id=&quot;userid&quot;\/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;label for=&quot;password&quot;&gt;\u30d1\u30b9\u30ef\u30fc\u30c9&lt;\/label&gt;\uff1a\r\n  &lt;input type=&quot;text&quot; name=&quot;formPassword&quot; id=&quot;password&quot;\/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;input type=&quot;submit&quot; name=&quot;login&quot; value=&quot;\u30ed\u30b0\u30a4\u30f3&quot; \/&gt;\r\n&lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n&lt;?php\r\n}\r\n\r\n\/\/\u30a8\u30e9\u30fc\u8868\u793a\u95a2\u6570\r\nfunction error($errorType) {\r\n  \r\n  switch($errorType) {\r\n    case 1:\r\n    $errorMsg = &quot;ID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;;\r\n    break;\r\n    \r\n    case 2:\r\n    $errorMsg = &quot;ID\u304c\u9055\u3044\u307e\u3059&quot;;\r\n    break;\r\n    \r\n    case 3:\r\n    $errorMsg = &quot;\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u9055\u3044\u307e\u3059&quot;;\r\n    break;\r\n}\r\n?&gt;\t\r\n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt;\r\n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot; \/&gt;\r\n&lt;title&gt;\u30ed\u30b0\u30a4\u30f3&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;\u30a8\u30e9\u30fc\u30da\u30fc\u30b8&lt;\/h1&gt;\r\n&lt;?php\r\n  print $errorMsg;\r\n?&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt; \r\n&lt;?php\r\n}\r\n?&gt;\r\n<\/pre>\n<p>\u8981\u70b9\u306e\u307f\u3001\u89e3\u8aac\u3092\u3002\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">session_start();<\/pre>\n<p>\u4eca\u304b\u3089\u3001session\u3092\u958b\u59cb\u3057\u307e\u3059\u3088\u30fc\u3068\u306e\u3053\u3068\u3067\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if(!isset($_POST&#x5B;'login'])) {<\/pre>\n<p>\u3053\u3061\u3089\u3001isset\u306f\u5909\u6570\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u304c NULL\u3067\u306a\u3044\u3053\u3068\u3092\u8abf\u3079\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a\u3055\u305b\u308b\u95a2\u6570 inputForm(); \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$formUserId = $_POST&#x5B;'formUserid'];\r\n$formPassword = $_POST&#x5B;'formPassword'];<\/pre>\n<p>\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u5024\u3092\u305d\u308c\u305e\u308c\u3001$formUserId\u3001$formPassword\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u3069\u3061\u3089\u3082\u8a18\u5165\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f error(1);\u3092\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$query = \"select * from members\";\r\n$result = mysql_query($query);<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u5f8c\u306equery\u6587\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">while($data = mysql_fetch_array($result)) {\r\n  if($data&#x5B;'userid'] == $formUserId) {\r\n    $dbPassword = $data&#x5B;'password'];\r\n    break;\r\n  }\r\n}<\/pre>\n<p>mysql_fetch_array\u306f\u9023\u60f3\u914d\u5217\u3001\u6dfb\u5b57\u914d\u5217\u3001\u307e\u305f\u306f\u305d\u306e\u4e21\u65b9\u3068\u3057\u3066\u7d50\u679c\u306e\u884c\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u305d\u308c\u3089\u3092$data\u306b\u4ee3\u5165\u3002<\/p>\n<p>\u3053\u3053\u306e\u51e6\u7406\u3068\u3057\u3066\u3001\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53d6\u5f97\u3057\u305fUSERID\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306eUSERID\u304c\u4e00\u81f4\u3057\u305f\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306ePASSWORD\u3092\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mysql_close($conn);<\/pre>\n<p>\u3057\u3063\u304b\u308a\u9589\u3058\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if(!isset($dbPassword)) {\r\nerror(2);<\/pre>\n<p>$dbPassword\u3068\u3044\u3046\u5909\u6570\u306b\u5024\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u2192\u3064\u307e\u308a\u3001formUserId\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eID\u304c\u4e0d\u4e00\u81f4\u306e\u5834\u5408\u306ferror(2);\u3092\u5b9f\u884c\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if($dbPassword != $formPassword){\r\n  error(3);<\/pre>\n<p>&lt;p\u3053\u3061\u3089\u306f\u30d5\u30a9\u30fc\u30e0\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e0d\u4e00\u81f4\u306ferror(3);\u3092\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$_SESSION&#x5B;'loginUser'] = $formUserId;\r\nheader(\"Location:test.php\");<\/pre>\n<p>\u6210\u529f\u3057\u305f\u969b\u3001\u30bb\u30c3\u30b7\u30e7\u30f3 &#8216;loginUser&#8217;\u306b\u30e6\u30fc\u30b6\u30fcid\u3092\u4ee3\u5165\u3057\u3066\u3001test.php\u306b\u30da\u30fc\u30b8\u79fb\u52d5\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">function error($errorType) {\r\n  switch($errorType) {<\/pre>\n<p>\u30a8\u30e9\u30fc\u306b\u95a2\u3057\u3066\u306fswitch\u6587\u3067\u632f\u308a\u5206\u3051\u305d\u308c\u305e\u308c\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5909\u3048\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<h4>style.css<\/h4>\n<p>\u6700\u5f8c\u3001\u8aad\u307f\u8fbc\u3080css\u306f\u3053\u3061\u3089\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">@charset \"UTF-8\";\r\n* {\r\n  margin: 0px;\r\n  padding: 0px;\r\n}\r\na:link, a:visited {\r\n  color: #C00;\r\n  text-decoration: none;\r\n}\r\na:hover {\r\n  color: #F00;\r\n}\r\nbody {\r\n  background: #FFF;\r\n  font-family: \"\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 Pro W3\",\"\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af\",Osaka,sans-serif;\r\n  font-size: 0.75em;\r\n  color: #22304C;\r\n}\r\ntable {\r\n  width: 600px;\r\n  margin: 20px auto;\r\n  border: 1px solid #78849C;\r\n}\r\ncaption {\r\n  margin-bottom: 10px;\r\n  text-align: left;\r\n  font-size: 1.6em;\r\n  color: #000;\r\n}\r\ntd {\r\n  padding: 8px 0px 8px 15px;\r\n  border: 1px solid #B5BBC8;\r\n}\r\ntd.item {\r\n  background: #E7E9EF;\r\n  color: #22304C;\r\n}\r\ndiv {\r\n  width: 600px;\r\n  margin: 0px auto;\r\n  text-align: center;\r\n}\r\ndiv.error-msg {\r\n  width: 600px;\r\n  margin: 20px auto;\r\n  text-align: left;\r\n}<\/pre>\n<p>\u4eca\u56de\u306f\u57fa\u790e\u7684\u306a\u3068\u3053\u308d\u306a\u306e\u3067\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u304c\u7518\u3044\u90e8\u5206\u3060\u3063\u305f\u308a\u3001\u9077\u79fb\u304c\u7121\u304b\u3063\u305f\u308a\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u6642\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u305f\u308a\u3068\u3001\u591a\u3005\u8db3\u308a\u306a\u3044\u70b9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u4efb\u610f\u3067\u7de8\u96c6\u3057\u3066\u9802\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089\u306b\u3082\u516c\u958b\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>Github<\/p>\n<p><a href=\"https:\/\/github.com\/webcyou\/sample\/tree\/master\/php\/members\">https:\/\/github.com\/webcyou\/sample\/tree\/master\/php\/members<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e PHP \u4f1a\u54e1\u5236\u30b5\u30a4\u30c8\u306e\u5236\u4f5c\u65b9\u6cd5 \u305d\u306e2 \u306e\u7d9a\u304d\u3068\u306a\u308a\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001 user_regist.php\uff1a\u4f1a\u54e1\u767b\u9332\u3068\u767b\u9332\u5185\u5bb9\u9001\u4fe1\u30d5\u30a1\u30a4\u30eb index.php\uff1a\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u51e6\u7406\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30da\u30fc\u30b8 \u306e2\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001 [&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":[107,180,173,44,45,111],"class_list":{"0":"post-4501","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-php","7":"tag-mamp","8":"tag-mysql","9":"tag-php","10":"tag-web","12":"tag-wordpress-2"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4501","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=4501"}],"version-history":[{"count":10,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4501\/revisions"}],"predecessor-version":[{"id":10788,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/4501\/revisions\/10788"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}