{"id":307993,"date":"2020-08-05T03:00:24","date_gmt":"2020-08-05T03:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307993"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307993","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c PHP + MySQL + Ajax"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513860\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c! \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c PHP 7. \u0421\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0438, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043b\u0438\u0431\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435, \u043b\u0438\u0431\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c. \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u043d\u0430\u0442\u044c PHP 7, MySQL, JavaScript \u0438 Ajax. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h2>Front-End<\/h2>\n<p>  <\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u0430\u043f\u043a\u0438.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/k2\/kg\/ue\/k2kguerugfznobxm0x-waw7sloc.png\"><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0430\u043c\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f.<br \/>  \u0412 <b>comments.php:<\/b>  <\/p>\n<pre><code class=\"php\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;ru&quot;&gt; &lt;head&gt;   &lt;title&gt;\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438&lt;\/title&gt;   &lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/style.css&quot;&gt;   &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=utf-8&quot;&gt;   &lt;script type=&quot;text\/javascript&quot; src=&quot;js\/jquery-1.5.1.min.js&quot;&gt;&lt;\/script&gt; &lt;\/head&gt;  &lt;body&gt;   &lt;form action=&quot;sendMessage.php&quot; method=&quot;post&quot; name=&quot;form&quot;&gt;     &lt;p class=&quot;is-h&quot;&gt;\u0410\u0432\u0442\u043e\u0440:&lt;br&gt; &lt;input name=&quot;author&quot; type=&quot;text&quot; class=&quot;is-input&quot; id=&quot;author&quot;&gt;&lt;\/p&gt;     &lt;p class=&quot;is-h&quot;&gt;\u0422\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:&lt;br&gt;&lt;textarea name=&quot;message&quot; rows=&quot;5&quot; cols=&quot;50&quot; id=&quot;message&quot;&gt;&lt;\/textarea&gt;&lt;\/p&gt;     &lt;input name=&quot;js&quot; type=&quot;hidden&quot; value=&quot;no&quot; id=&quot;js&quot;&gt;     &lt;button type=&quot;submit&quot; id='click' name=&quot;button&quot; class=&quot;is-button&quot;&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt;   &lt;\/form&gt;   &lt;div class=&quot;clear&quot;&gt;    &lt;\/div&gt;    &lt;p&gt;\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0441\u0442\u0430\u0442\u044c\u0435&lt;\/p&gt;    &lt;div id=&quot;commentBlock&quot;&gt; &lt;!-- \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 --&gt;   &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt;   <\/code><\/pre>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0411\u0414<\/h2>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0411\u0430\u0437\u044b \u0414\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c \u0411\u0430\u0437\u0443 \u0414\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443: <br \/>  \u0411\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0437\u043e\u0432\u0435\u043c <b>test<\/b>.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443: <br \/>  <code>CREATE TABLE `test`.`messages` ( `id` INT(255) UNSIGNED NOT NULL AUTO_INCREMENT , `author` VARCHAR(30) NOT NULL , `message` TEXT NOT NULL , `date` VARCHAR(25) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_general_ci;<br \/>  <\/code><br \/>  \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kj\/zv\/7t\/kjzv7tbmrje3veisnxbht9bdeje.png\"><\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0430\u0437\u0435 \u0414\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a \u0441\u0430\u043c\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f.<br \/>  \u0412 \u0444\u0430\u0439\u043b\u0435 <b>connect.php<\/b> \u043f\u0438\u0448\u0435\u043c:   <\/p>\n<pre><code class=\"php\">&lt;?php $mysql = new mysqli('localhost', 'login', 'password', 'test'); ?&gt; <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e login \u0438 password \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0443 \u043c\u0435\u043d\u044f login root, \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u2014 root:   <\/p>\n<pre><code class=\"php\">&lt;?php $mysql = new mysqli('localhost', 'root', 'root', 'test'); ?&gt; <\/code><\/pre>\n<p>  test \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0411\u0430\u0437\u044b \u0414\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041f\u0438\u0448\u0435\u043c \u0441\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442<\/h2>\n<p>  <\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439. \u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0444\u043e\u0440\u043c\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435 \u0441 \u043d\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0412 <b>style.css<\/b> \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c:   <\/p>\n<pre><code class=\"css\">* {   max-width: 800px;   margin: 0 auto; }  textarea {   resize: none; }  .clear {   margin-top: 50px; }  #author {   width: 100%;   height: 4%;   font-size: 1.3em; }  .is-h {   font-weight: bold;   font-family: cursive;   margin-top: 2%; }  #message {   width: 100%;   font-size: 1.5em; }  .is-button {   cursor: pointer;   color: white;   background-color: green;   width: 25%;   height: 50px;   margin-top: 1%;   outline: none; \/* \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u043d\u0438\u044e \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 *\/   font-weight: bold;   font-family: cursive;   font-size: 1.2em;   border: none;   transition: all 0.3s ease-out; }  .is-button:hover {   color: black;   background: rgb(48, 184, 66); } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u0444\u043e\u0440\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0442\u0430\u043a: <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ys\/zr\/mu\/yszrmu0epwfengptm41chihhjyo.png\"><\/p>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AJAX<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0438\u0445 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432 PHP \u043d\u0430 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443: <br \/>  \u0412 \u0444\u0430\u0439\u043b\u0435 comments.php, \u0432 \u0442\u0435\u0433\u0435 script \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c:   <\/p>\n<pre><code class=\"javascript\">$(function() {     $(&quot;#send&quot;).click(function(){ \/\/ \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443       var author = $(&quot;#author&quot;).val(); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f       var message = $(&quot;#message&quot;).val(); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435       $.ajax({ \/\/ \u0410\u044f\u043a\u0441         type: &quot;POST&quot;, \/\/ \u0422\u0438\u043f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 &quot;POST&quot;         url: &quot;sendMessage.php&quot;, \/\/ \u041a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c(\u0432 \u043a\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b)         data: {&quot;author&quot;: author, &quot;message&quot;: message}, \/\/ \u0427\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438 \u043f\u043e\u0434 \u043a\u0430\u043a\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c          cache: false, \/\/ \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435         success: function(response){ \/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e           var messageResp = new Array('\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e','\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445','\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f');           var resultStat = messageResp[Number(response)];           if(response == 0){              $(&quot;#author&quot;).val(&quot;&quot;);             $(&quot;#message&quot;).val(&quot;&quot;);             $(&quot;#commentBlock&quot;).append(&quot;&lt;div class='comment'&gt;\u0410\u0432\u0442\u043e\u0440: &lt;strong&gt;&quot;+author+&quot;&lt;\/strong&gt;&lt;br&gt;&quot;+message+&quot;&lt;\/div&gt;&quot;);}             $(&quot;#resp&quot;).text(resultStat).show().delay(1500).fadeOut(800);}});return false;});}); <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0445 \u0432 \u0411\u0414<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u00ab\u0441\u043b\u043e\u0432\u0438\u0442\u044c\u00bb \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 AJAX. \u0412 <b>sendMessage.php<\/b> \u043f\u0438\u0448\u0435\u043c:  <\/p>\n<pre><code class=\"php\">&lt;?php include(&quot;connect.php&quot;); \/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0411\u0414 header(&quot;Content-type: text\/html; charset=UTF-8&quot;); \/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443  \/\/\u0415\u0441\u043b\u0438 JS \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d if(empty($_POST['js'])){  \tif($_POST['message'] != '' &amp;&amp; $_POST['author'] != ''){ \/\/ \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044f \u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u0435  \t\t$author = @iconv(&quot;UTF-8&quot;, &quot;windows-1251&quot;, $_POST['author']); \t\t$author = addslashes($author); \t\t$author = htmlspecialchars($author); \t\t$author = stripslashes($author); \t\t$author = mysql_real_escape_string($author); \/\/ \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435  \t\t$message = @iconv(&quot;UTF-8&quot;, &quot;windows-1251&quot;, $_POST['message']); \t\t$message = addslashes($message); \t\t$message = htmlspecialchars($message); \t\t$message = stripslashes($message); \t\t$message = mysql_real_escape_string($message); \/\/ \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435  \t\t$date = date(&quot;d-m-Y \u0432 H:i:s&quot;); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0443(\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c) \t\t$result = $mysql-&gt;query(&quot;INSERT INTO `messages` (`author`, `message`, `date`) VALUES ('$author', '$message', '$date')&quot;); \/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u0411\u0414 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \t\tif($result == true){ \t\t\techo 0; \/\/\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \t\t}else{ \t\t\techo 1; \/\/\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \t\t} \t}else{ \t\techo 2; \/\/\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \t} }  \/\/ \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d JavaScript   if($_POST['js'] == 'no'){ \tif($_POST['message'] != '' &amp;&amp; $_POST['author'] != ''){  \t\t$author = $_POST['author']; \t\t$author = addslashes($author); \t\t$author = htmlspecialchars($author); \t\t$author = stripslashes($author);  \t\t$message = $_POST['message']; \t\t$message = addslashes($message); \t\t$message = htmlspecialchars($message); \t\t$message = stripslashes($message);  \t\t$date = date(&quot;d-m-Y \u0432 H:i:s&quot;); \t\t$result = $mysql-&gt;query(&quot;INSERT INTO `messages` (`author`, `message`, `date`) VALUES ('$author', '$message', '$date')&quot;); \t\tif($result == true){ \t\t\techo &quot;\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e&quot;; \/\/\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \t\t}else{ \t\t\techo &quot;\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445&quot;; \/\/\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \t\t} \t}else{ \t\techo &quot;\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f&quot;; \/\/\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \t} } ?&gt; <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u0433\u043b\u0430\u0437\u0430 \u0444\u043e\u0440\u043c\u0435.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0411\u0414 \u0432 <b>comments.php<\/b>. \u0412 \u0441\u0430\u043c\u043e\u043c \u0432\u0435\u0440\u0445\u0443 \u043f\u0438\u0448\u0435\u043c:  <\/p>\n<pre><code class=\"php\">&lt;?php require 'connect.php'; ?&gt;<\/code><\/pre>\n<p>  \u0412 div \u0441 id=\u00abcommentBlock\u00bb \u0432 \u0444\u0430\u0439\u043b\u0435 <b>comments.php<\/b> \u043f\u0438\u0448\u0435\u043c:   <\/p>\n<pre><code class=\"php\">&lt;?php             $result = $mysql-&gt;query(&quot;SELECT * FROM `messages`&quot;); \/*\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b*\/             $comment = $result-&gt;fetch_assoc(); \/* \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 *\/             do{echo &quot;&lt;div class='comment' style='border: 1px solid gray; margin-top: 1%; border-radius: 5px; padding: 0.5%;'&gt;\u0410\u0432\u0442\u043e\u0440: &lt;strong&gt;&quot;.$comment['author'].&quot;&lt;\/strong&gt;&lt;br&gt;&quot;.$comment['message'].&quot;&lt;\/div&gt;&quot;; \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c           }while($comment = $result-&gt;fetch_assoc());           ?&gt; <\/code><\/pre>\n<p>  \u041f\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e: <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5v\/m-\/dp\/5vm-dpyjdng_l3dxo61uxsxivhe.png\"><br \/>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0412\u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438:<br \/>  <b>comments.php<\/b>  <\/p>\n<pre><code class=\"php\">&lt;?php require 'connect.php'; ?&gt; &lt;!DOCTYPE html&gt; &lt;html lang=&quot;ru&quot;&gt; &lt;head&gt;   &lt;title&gt;\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438&lt;\/title&gt;   &lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/style.css&quot;&gt;   &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=utf-8&quot;&gt;   &lt;script type=&quot;text\/javascript&quot; src=&quot;js\/jquery-1.5.1.min.js&quot;&gt;&lt;\/script&gt;   &lt;script type=&quot;text\/javascript&quot;&gt;   $(function() {     $(&quot;#send&quot;).click(function(){       var author = $(&quot;#author&quot;).val();       var message = $(&quot;#message&quot;).val();       $.ajax({         type: &quot;POST&quot;,         url: &quot;sendMessage.php&quot;,         data: {&quot;author&quot;: author, &quot;message&quot;: message},         cache: false,         success: function(response){           var messageResp = new Array('\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e','\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445','\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f');           var resultStat = messageResp[Number(response)];           if(response == 0){             $(&quot;#author&quot;).val(&quot;&quot;);             $(&quot;#message&quot;).val(&quot;&quot;);             $(&quot;#commentBlock&quot;).append(&quot;&lt;div class='comment'&gt;\u0410\u0432\u0442\u043e\u0440: &lt;strong&gt;&quot;+author+&quot;&lt;\/strong&gt;&lt;br&gt;&quot;+message+&quot;&lt;\/div&gt;&quot;);}             $(&quot;#resp&quot;).text(resultStat).show().delay(1500).fadeOut(800);}});return false;});});             &lt;\/script&gt;           &lt;\/head&gt;                      &lt;body&gt;             &lt;form action=&quot;sendMessage.php&quot; method=&quot;post&quot; name=&quot;form&quot;&gt;               &lt;p class=&quot;is-h&quot;&gt;\u0410\u0432\u0442\u043e\u0440:&lt;br&gt; &lt;input name=&quot;author&quot; type=&quot;text&quot; class=&quot;is-input&quot; id=&quot;author&quot;&gt;&lt;\/p&gt;               &lt;p class=&quot;is-h&quot;&gt;\u0422\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:&lt;br&gt;&lt;textarea name=&quot;message&quot; rows=&quot;5&quot; cols=&quot;50&quot; id=&quot;message&quot;&gt;&lt;\/textarea&gt;&lt;\/p&gt;               &lt;input name=&quot;js&quot; type=&quot;hidden&quot; value=&quot;no&quot; id=&quot;js&quot;&gt;               &lt;button type=&quot;submit&quot; id='click' name=&quot;button&quot; class=&quot;is-button&quot;&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt;             &lt;\/form&gt;             &lt;div class=&quot;clear&quot;&gt;                            &lt;\/div&gt;                          &lt;p&gt;\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0441\u0442\u0430\u0442\u044c\u0435&lt;\/p&gt;                          &lt;div id=&quot;commentBlock&quot;&gt;               &lt;?php               $result = $mysql-&gt;query(&quot;SELECT * FROM `messages`&quot;);               $comment = $result-&gt;fetch_assoc();               do{echo &quot;&lt;div class='comment' style='border: 1px solid gray; margin-top: 1%; border-radius: 5px; padding: 0.5%;'&gt;\u0410\u0432\u0442\u043e\u0440: &lt;strong&gt;&quot;.$comment['author'].&quot;&lt;\/strong&gt;&lt;br&gt;&quot;.$comment['message'].&quot;&lt;\/div&gt;&quot;;               }while($comment = $result-&gt;fetch_assoc());               ?&gt;             &lt;\/div&gt;           &lt;\/body&gt;           &lt;\/html&gt; <\/code><\/pre>\n<p>  <b>sendMessage.php<\/b>:  <\/p>\n<pre><code class=\"php\">&lt;?php include(&quot;connect.php&quot;); header(&quot;Content-type: text\/html; charset=UTF-8&quot;);  \/\/********************************************** if(empty($_POST['js'])){ \tif($_POST['message'] != '' &amp;&amp; $_POST['author'] != ''){  \t\t$author = @iconv(&quot;UTF-8&quot;, &quot;windows-1251&quot;, $_POST['author']); \t\t$author = addslashes($author); \t\t$author = htmlspecialchars($author); \t\t$author = stripslashes($author); \t\t$author = mysql_real_escape_string($author);  \t\t$message = @iconv(&quot;UTF-8&quot;, &quot;windows-1251&quot;, $_POST['message']); \t\t$message = addslashes($message); \t\t$message = htmlspecialchars($message); \t\t$message = stripslashes($message); \t\t$message = mysql_real_escape_string($message);  \t\t$date = date(&quot;d-m-Y \u0432 H:i:s&quot;); \t\t$result = $mysql-&gt;query(&quot;INSERT INTO `messages` (`author`, `message`, `date`) VALUES ('$author', '$message', '$date')&quot;); \t\tif($result == true){ \t\t\techo 0; \/\/\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \t\t}else{ \t\t\techo 1; \/\/\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \t\t} \t}else{ \t\techo 2; \/\/\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \t} }  \/\/**************************************** \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d JavaScript ************************************  if($_POST['js'] == 'no'){ \tif($_POST['message'] != '' &amp;&amp; $_POST['author'] != ''){  \t\t$author = $_POST['author']; \t\t$author = addslashes($author); \t\t$author = htmlspecialchars($author); \t\t$author = stripslashes($author);  \t\t$message = $_POST['message']; \t\t$message = addslashes($message); \t\t$message = htmlspecialchars($message); \t\t$message = stripslashes($message);  \t\t$date = date(&quot;d-m-Y \u0432 H:i:s&quot;); \t\t$result = $mysql-&gt;query(&quot;INSERT INTO `messages` (`author`, `message`, `date`) VALUES ('$author', '$message', '$date')&quot;); \t\tif($result == true){ \t\t\techo &quot;\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e&quot;; \/\/\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \t\t}else{ \t\t\techo &quot;\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445&quot;; \/\/\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \t\t} \t}else{ \t\techo &quot;\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f&quot;; \/\/\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \t} } ?&gt; <\/code><\/pre>\n<p>  <b>connect.php<\/b>:  <\/p>\n<pre><code class=\"php\">&lt;?php $mysql = new mysqli('localhost', 'root', 'root', 'test'); ?&gt; <\/code><\/pre>\n<p>  <b>style.css:<\/b>  <\/p>\n<pre><code class=\"css\">* {   max-width: 800px;   margin: 0 auto; }  textarea {   resize: none; }  .clear {   margin-top: 50px; }  #author {   width: 100%;   height: 4%;   font-size: 1.3em; }  .is-h {   font-weight: bold;   font-family: cursive;   margin-top: 2%; }  #message {   width: 100%;   font-size: 1.5em; }  .is-button {   cursor: pointer;   color: white;   background-color: green;   width: 25%;   height: 50px;   margin-top: 1%;   outline: none; \/* \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u043d\u0438\u044e \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 *\/   font-weight: bold;   font-family: cursive;   font-size: 1.2em;   border: none;   transition: all 0.3s ease-out; }  .is-button:hover {   color: black;   background: rgb(48, 184, 66); } <\/code><\/pre>\n<p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/513860\/\"> https:\/\/habr.com\/ru\/post\/513860\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513860\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c! \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c PHP 7. \u0421\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0438, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043b\u0438\u0431\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435, \u043b\u0438\u0431\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c. \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u043d\u0430\u0442\u044c PHP 7, MySQL, JavaScript \u0438 Ajax. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307993","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307993"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307993\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}