{"id":236740,"date":"2017-01-29T08:02:30","date_gmt":"2017-01-29T08:02:30","guid":{"rendered":"https:\/\/ru.wordpress.org\/support\/topic\/%d1%84%d0%be%d1%80%d0%bc%d0%b0-%d0%be%d1%82%d0%bf%d1%80%d0%b0%d0%b2%d0%ba%d0%b8-%d0%bc%d0%b0%d0%b8%d0%bb%d0%b0\/"},"modified":"2017-01-29T08:03:54","modified_gmt":"2017-01-29T08:03:54","slug":"%d1%84%d0%be%d1%80%d0%bc%d0%b0-%d0%be%d1%82%d0%bf%d1%80%d0%b0%d0%b2%d0%ba%d0%b8-%d0%bc%d0%b0%d0%b8%d0%bb%d0%b0","status":"publish","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d1%84%d0%be%d1%80%d0%bc%d0%b0-%d0%be%d1%82%d0%bf%d1%80%d0%b0%d0%b2%d0%ba%d0%b8-%d0%bc%d0%b0%d0%b8%d0%bb%d0%b0\/","title":{"rendered":"\u0424\u043e\u0440\u043c\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u0430\u0438\u043b\u0430"},"content":{"rendered":"<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u0445\u043e\u0447\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u0435\u0438\u043b\u0430 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043e\u0441\u0442\u0430. \u0421\u043e\u0437\u0434\u0430\u043b email.php \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0432 loop-single.php \u043f\u0443\u0442\u0435\u043c<br \/>\n<code>&lt;?php include_once( dirname(__FILE__) . &#039;\/email.php&#039;); ?&gt;<\/code><br \/>\n\u041a\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438(email.php):<\/p>\n<pre><code>\n$to  = &#039;\u0447\u0442\u043e\u0442\u043e@gmail.com&#039;;\n\t$error=0;\n\techo &#039;&lt;form enctype=&quot;multipart\/form-data&quot; method=&quot;post&quot; action=&quot;\/&#039;.str_replace(network_home_url(), &#039;&#039;, get_permalink()) .&#039;&quot; id=&quot;contactform&quot;&gt;\n\t&lt;label for=&quot;isk_name&quot;&gt;Name:&lt;input type=&quot;text&quot; name=&quot;isk_name&quot;&gt;&lt;\/label&gt;\n\t&lt;label for=&quot;emailfrom&quot;&gt;Email:&lt;input type=&quot;email&quot; name=&quot;emailfrom&quot;&gt;&lt;\/label&gt;\n\t&lt;label for=&quot;subjectsubjectsubject&quot;&gt;Subject:&lt;input type=&quot;text&quot; name=&quot;subject&quot;&gt;&lt;\/label&gt;\n\t&lt;label for=&quot;message&quot;&gt;&lt;strong&gt;\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:&lt;\/strong&gt;&lt;\/label&gt;\n\t\t\t&lt;textarea rows=&quot;5&quot; cols=&quot;50&quot; name=&quot;message&quot; id=&quot;message&quot; class=&quot;required&quot;&gt;&lt;\/textarea&gt;\n\t&lt;button type=&quot;submit&quot; name=&quot;isk_submit&quot;&gt;Send&lt;\/button&gt;\n\t &lt;\/form&gt;&#039;;\n\n\tif (isset($_POST[&#039;isk_submit&#039;])){\n\t\tget_header();\n\t\tif(trim($_POST[&#039;emailfrom&#039;]) == &#039;&#039;)  {\n\t\t\t$error=1;\n\t\t} else {\n\t\t\t$from = trim($_POST[&#039;emailfrom&#039;]);\n\t\t\t\/\/echo &#039;&lt;script type=&quot;text\/javascript&quot;&gt;alert(&quot;zzzzz&quot;)&lt;\/script&gt;&#039;;\n\t\t}\n\t\tif(trim($_POST[&#039;subject&#039;]) == &#039;&#039;)  {\n\t\t\t$error=1;\n\t\t}else {\n\t\t\t$subject = trim($_POST[&#039;subject&#039;]);\n\t\t}\n\t\tif(trim($_POST[&#039;isk_name&#039;]) == &#039;&#039;)  {\n\t\t\t$error=1;\n\t\t}else {\n\t\t\t$isk_name = trim($_POST[&#039;isk_name&#039;]);\n\t\t}\n\t\tif(trim($_POST[&#039;message&#039;]) == &#039;&#039;) {\n\t\t$hasError = true;\n\t\t} else {\n\t\t\tif(function_exists(&#039;stripslashes&#039;)) {\n\t\t\t\t$comments = stripslashes(trim($_POST[&#039;message&#039;]));\n\t\t\t} else {\n\t\t\t\t$comments = trim($_POST[&#039;message&#039;]);\n\t\t\t}\n\t\t}\n\t\tif ($error==1) {\n\t\t\techo &#039;&lt;script type=&quot;text\/javascript&quot;&gt;alert(&quot;Error&quot;)&lt;\/script&gt;&#039;;\n\t\t}else {\n\t\t\t$body = &quot;Name: $isk_name \\n\\nEmail: $from \\n\\nSubject: $subject \\n\\nComments:\\n $comments&quot;;\n\t\t\t$headers = &#039;From: My Site &lt;&#039;.$from.&#039;&gt;&#039; . &quot;\\r\\n&quot; . &#039;Reply-To: &#039; . $to;\n\t\t\twp_mail($to, $subject, $body, $headers);\n\t\t}\n\t\t\n\t}\t\n<\/code><\/pre>\n<p>\u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u0441\u044b\u043b\u043a\u0438 \u043f\u043e\u0447\u0442\u044b, \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e.<br \/>\n \u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0438\u043b\u0430. \u0422.\u0435.<br \/>\n<code>$headers = &#039;From: My Site &lt;&#039;.$from.&#039;&gt;&#039; . &quot;\\r\\n&quot; . &#039;Reply-To: &#039; . $to;<\/code><br \/>\n\u041f\u043e\u043c\u043e\u0433\u0438\u0442\u0435 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/p>\n","protected":false},"template":"","class_list":["post-236740","topic","type-topic","status-publish","hentry","topic-tag-493"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/236740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/236740\/revisions"}],"predecessor-version":[{"id":236741,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/236740\/revisions\/236741"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=236740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}