{"id":59151,"date":"2025-04-23T16:52:32","date_gmt":"2025-04-23T08:52:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59151\/"},"modified":"2025-04-23T16:52:32","modified_gmt":"2025-04-23T08:52:32","slug":"%e5%b0%86ecshop%e4%bc%9a%e5%91%98%e6%b3%a8%e5%86%8c%e9%a1%b5%e7%9a%84e-mail%e7%94%b1%e5%bf%85%e5%a1%ab%e9%a1%b9%e6%94%b9%e4%b8%ba%e9%9d%9e%e5%bf%85%e5%a1%ab%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59151\/","title":{"rendered":"\u5c06ecshop\u4f1a\u5458\u6ce8\u518c\u9875\u7684E-MAIL\u7531\u5fc5\u586b\u9879\u6539\u4e3a\u975e\u5fc5\u586b\u9879"},"content":{"rendered":"<p>\u5c06ecshop\u4f1a\u5458\u6ce8\u518c\u9875\u7684E-MAIL\u7531\u5fc5\u586b\u9879\u6539\u4e3a\u975e\u5fc5\u586b\u9879<br \/> \u4ee5\u4e0b\u4fee\u6539\u662f ECSHOP2.7.1\u7248 <span>\u5b98\u65b9<\/span>\u9ed8\u8ba4<span>\u6a21\u677f<\/span>\u57fa\u7840\u4e0a\u505a\u7684\u4fee\u6539\uff0c\u5176\u4ed6\u7248\u672c\u6216\u5176\u4ed6\u6a21\u677f\uff0c\u5927\u540c\u5c0f\u5f02\u3002<\/p>\n<p> 1\u3001<br \/> \u6253\u5f00 user_passport.dwt <span>\u6587\u4ef6<\/span><br \/> \u5c06<br \/> onblur=&#8221;checkEmail(this.value);&#8221;<br \/> <span>\u5220\u9664<\/span><br \/> \u5e76\u5c06<br \/> &lt;span id=&#8221;email_notice&#8221; style=&#8221;color:#FF0000&#8243;&gt; *&lt;\/span&gt;<br \/> \u4e5f\u5220\u9664<br \/> 2\u3001<br \/> \u6253\u5f00 js\/user.js \u6587\u4ef6\uff0c\u627e\u5230 register() \u51fd\u6570\u90e8\u5206<br \/> \u5c06\uff08\u5927\u6982\u5728466\u884c\u5de6\u53f3\uff0c\u8fd9\u91cc\u5343\u4e07\u522b\u627e\u9519\u5730\u65b9\uff09<\/p>\n<p><span style=\"color: #ff0000\">if (email.length == 0)<br \/> &nbsp; {<br \/> &nbsp;&nbsp;&nbsp; msg += email_empty + &#8216;\\n&#8217;;<br \/> &nbsp; }<br \/> &nbsp; else<br \/> &nbsp; {<br \/> &nbsp;&nbsp;&nbsp; if ( ! (Utils.isEmail(email)))<br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg += email_invalid + &#8216;\\n&#8217;;<br \/> &nbsp;&nbsp;&nbsp; }<br \/> &nbsp; }<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000\"><font>\u5220\u9664<br \/> &nbsp;&nbsp;3\u3001\u6253\u5f00 includes\/lib_passport.php \u6587\u4ef6\uff0c\u627e\u5230 register&nbsp;&nbsp;\u51fd\u6570\u90e8\u5206<br \/> &nbsp;&nbsp;\u5c06\uff08\u5927\u6982\u572840\u884c\u5de6\u53f3\uff09&nbsp;<\/font><\/span><\/p>\n<p><span style=\"color: #ff0000\"><font>&nbsp; \/* \u68c0\u67e5email *\/<br \/> &nbsp;&nbsp;&nbsp; if (empty($email))<br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GLOBALS[&#8216;err&#8217;]-&gt;add($GLOBALS[&#8216;_LANG&#8217;][&#8217;email_empty&#8217;]);<br \/> &nbsp;&nbsp;&nbsp; }<br \/> &nbsp;&nbsp;&nbsp; else<br \/> &nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!is_email($email))<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GLOBALS[&#8216;err&#8217;]-&gt;add(sprintf($GLOBALS[&#8216;_LANG&#8217;][&#8217;email_invalid&#8217;], htmlspecialchars($email)));<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/> &nbsp;&nbsp;&nbsp; }<br \/> &nbsp;&nbsp;<\/font><\/span><\/p>\n<p><span style=\"color: #ff0000\"><font><font>\u5220\u9664<\/p>\n<p> <\/font><font>4\u3001\u7ee7\u7eed\u6253\u5f00 includes\/modules\/integrates\/integrate.php \u6587\u4ef6<\/p>\n<p> \u627e\u5230\uff08\u5927\u6982\u5728196\u884c\u5de6\u53f3\uff09<\/font><\/p>\n<p> <font>$sql = &#8220;SELECT &#8221; . $this-&gt;field_id .<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&#8221; FROM &#8221; . $this-&gt;table($this-&gt;user_table).<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&#8221; WHERE &#8221; . $this-&gt;field_email . &#8221; = &#8216;$email'&#8221;;<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if ($this-&gt;db-&gt;getOne($sql, true) &gt; 0)<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$this-&gt;<span>error<\/span> = ERR_EMAIL_EXISTS;<\/font><br \/> <font>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return false;<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br \/> <\/font><br \/> <font>\u5220\u9664\u4e4b<\/font>&nbsp;&nbsp;<\/font><br \/> &nbsp; <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06ecshop\u4f1a\u5458\u6ce8\u518c\u9875\u7684E-MAIL\u7531\u5fc5\u586b\u9879\u6539\u4e3a\u975e\u5fc5\u586b\u9879 \u4ee5\u4e0b\u4fee\u6539\u662f ECSHOP2.7.1\u7248 \u5b98\u65b9\u9ed8\u8ba4\u6a21\u677f\u57fa\u7840\u4e0a\u505a\u7684\u4fee\u6539\uff0c\u5176\u4ed6\u7248\u672c\u6216\u5176\u4ed6\u6a21\u677f\uff0c\u5927\u540c\u5c0f\u5f02\u3002 1\u3001 \u6253\u5f00 user_passport.dwt \u6587\u4ef6 \u5c06 onblur=&#8221;checkEmail(this.value);&#8221; \u5220\u9664 \u5e76\u5c06 &lt;span id=&#8221;email_notice&#8221; style=&#8221;color:#FF0000&#8243;&gt; *&lt;\/span&gt; \u4e5f\u5220\u9664 2\u3001 \u6253\u5f00 js\/user.js \u6587\u4ef6\uff0c\u627e\u5230 register() \u51fd\u6570\u90e8\u5206 \u5c06\uff08\u5927\u6982\u5728466\u884c\u5de6\u53f3\uff0c\u8fd9\u91cc\u5343\u4e07\u522b\u627e\u9519\u5730\u65b9\uff09 if (email.length == 0) &nbsp; { &nbsp;&nbsp;&nbsp; msg += email_empty + &#8216;\\n&#8217;; &nbsp; } &nbsp; else &nbsp; { &nbsp;&nbsp;&nbsp; if ( ! (Utils.isEmail(email))) &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg += email_invalid + &#8216;\\n&#8217;; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-59151","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=59151"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59151\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}