{"id":60810,"date":"2025-04-26T08:14:31","date_gmt":"2025-04-26T00:14:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60810\/"},"modified":"2025-04-26T08:14:31","modified_gmt":"2025-04-26T00:14:31","slug":"zencart%e6%b7%bb%e5%8a%a0%e4%b8%80%e4%b8%aa%e8%87%aa%e5%8a%a8%e6%b3%a8%e5%86%8c%e7%9a%84%e6%8e%a5%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60810\/","title":{"rendered":"zencart\u6dfb\u52a0\u4e00\u4e2a\u81ea\u52a8\u6ce8\u518c\u7684\u63a5\u53e3"},"content":{"rendered":"<p>\u63d0\u4f9b\u4e00\u4e2a\u81ea\u52a8\u6ce8\u518c\u7684\u63a5\u53e3\u3002  \u63a5\u6536\u7684\u53c2\u6570\uff1aopenid,nickname   &nbsp;   \u8fd4\u56de\u683c\u5f0f\uff1a   {&#8216;flag&#8217;:&#8217;true&#8217;\/&#8217;false&#8217;,&#8217;code&#8217;:&#8221;,&#8217;msg&#8217;:&#8221;,&#8217;attachparams&#8217;:{&#8216;param1&#8242;:&#8221;,&#8217;param2&#8242;:&#8221;}}   &nbsp;   1\u3001\u65b0\u5efa\u4e00\u4e2a\u8868   customers_auto   create table customers_auto(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;id int primary key auto_increment,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_id_name varchar(255),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_id_value varchar(255),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_type varchar(255),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;auto_email varchar(255),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;customers_id int   );  out_id_name\uff1a\u5916\u90e8id\u7684key\u540d\u79f0\uff0c\u5982&#8217;openid&#8217;  out_id_value\uff1a\u5916\u8868id\u7684\u503c\uff0c\u5982&#8217;zilshkksd9f0ak&#8217;   out_type\uff1a\u5916\u90e8\u8d26\u53f7\u7c7b\u578b   auto_email\uff1a\u7cfb\u7edf\u81ea\u52a8\u4ea7\u751f\u7684\u90ae\u7bb1\uff0c\u7528\u4e8e\u586b\u5145\u5230zencart\u672c\u8eab\u7684customers\u8868\u7684customers_email_address\u5b57\u6bb5   customers_id\uff1a\u662fzencart\u7684customers\u7684\u8868\u7684\u4e3b\u952e   &nbsp;   &nbsp;   2\u3001\u6539\u9020pages\/create_account\/\u4e0b\u7684header_php.php\u6587\u4ef6\uff1a   $openid = $_POST[&#8216;openid&#8217;];   if (!isset($openid)) {   &nbsp; &nbsp; require(DIR_WS_MODULES . zen_get_module_directory(&#8216;require_languages.php&#8217;));   &nbsp; &nbsp; include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CREATE_ACCOUNT));   &nbsp; &nbsp; $breadcrumb-&gt;add(NAVBAR_TITLE);   &nbsp;   \/\/ This should be last line of the script:   &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_HEADER_END_CREATE_ACCOUNT&#8217;);   } else {   &nbsp; &nbsp; include(DIR_WS_MODULES . zen_get_module_directory(&#8220;create_account_auto&#8221;));   &nbsp; &nbsp; exit;   }   &nbsp;   \u5982\u679c\u6709openid\u5c31\u5f15\u5165\u53e6\u4e00\u4e2a\u6587\u4ef6\u6765\u5904\u7406\uff0c\u5426\u5219\u5c31\u8d70\u5e73\u5e38\u7684\u3002   &nbsp;   2\u3001\u68c0\u67e5\u4f20\u9012\u7684\u53c2\u6570\uff0c   \u9a8c\u8bc1\u4f20\u9012\u7684openid\u662f\u5426\u5df2\u7ecf\u5b58\u5728\uff0c\u5982\u679c\u662f\uff0c\u5219\u8fd4\u56de\u5931\u8d25\uff0cmsg\u4e3a\u8d26\u53f7\u5df2\u5b58\u5728\uff1b   &nbsp;   3\u3001\u81ea\u52a8\u751f\u6210\u4e00\u4e2aemail\uff0c   \u683c\u5f0f\u4e3aopenid+&#8221;@zencart.com&#8221;   &nbsp;   &nbsp;   5\u3001\u63d2\u5165\u5230zencart\u7684customers\u8868   \u9700\u8981\u7684\u4fe1\u606f\u7528\u7a0b\u5e8f\u81ea\u52a8\u751f\u6210\u3002   \u83b7\u53d6\u5230\u5176customers_id\u4f9b\u4e0b\u4e00\u6b65\u4f7f\u7528\u3002   &nbsp;    4\u3001\u63d2\u5165\u5230customers_auto\u8868    \u641e\u5b9a\u3002\u5199\u4e00\u4e2a\u9875\u9762\u6d4b\u8bd5\u4e00\u4e0b\uff1a   testcreateacc.php   &lt;form action=&#8221;create_account_auto.php&#8221; method=&#8221;post&#8221;&gt;   &lt;input type=&#8221;text&#8221; name=&#8221;openid&#8221; value=&#8221;randomid&#8221; \/&gt;   &lt;input type=&#8221;text&#8221; name=&#8221;nickname&#8221; value=&#8221;little&#8221; \/&gt;   &nbsp;   &lt;input type=&#8221;submit&#8221; value=&#8221;\u63d0\u4ea4&#8221; \/&gt;   &lt;\/form&gt;   &nbsp;   create_account_auto.php   &lt;?php   $url=&#8221;http:\/\/localhost\/zencart\/index.php?main_page=create_account&#8221;;   $post_data=array(&#8216;openid&#8217;=&gt;$_REQUEST[&#8216;openid&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;nickname&#8217;=&gt;$_REQUEST[&#8216;nickname&#8217;]);   &nbsp; &nbsp; \/\/ var_dump($post_data);   \/\/$post_data=implode(&#8220;&amp;&#8221;,$post_data);   $ch=curl_init();   curl_setOpt($ch,CURLOPT_URL,$url);   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);   curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);   curl_setOpt($ch,CURLOPT_POST,1);   curl_setOpt($ch,CURLOPT_POSTFIELDS,$post_data);   $content=curl_exec($ch);   curl_close($ch);   echo $content;   ?&gt;   &nbsp;   \u6d4b\u8bd5\u8fd4\u56de\uff1a   {&#8216;flag&#8217;:&#8217;true&#8217;,&#8217;msg&#8217;:&#8217;success&#8217;}   \u91cd\u590d\u63d0\u4ea4\uff1a   {&#8216;flag&#8217;:&#8217;false&#8217;,&#8217;code&#8217;:&#8217;account_exist&#8217;,&#8217;msg&#8217;:&#8217;\u8d26\u53f7\u5df2\u7ecf\u5b58\u5728\uff01&#8217;}  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63d0\u4f9b\u4e00\u4e2a\u81ea\u52a8\u6ce8\u518c\u7684\u63a5\u53e3\u3002 \u63a5\u6536\u7684\u53c2\u6570\uff1aopenid,nickname &nbsp; \u8fd4\u56de\u683c\u5f0f\uff1a {&#8216;flag&#8217;:&#8217;true&#8217;\/&#8217;false&#8217;,&#8217;code&#8217;:&#8221;,&#8217;msg&#8217;:&#8221;,&#8217;attachparams&#8217;:{&#8216;param1&#8242;:&#8221;,&#8217;param2&#8242;:&#8221;}} &nbsp; 1\u3001\u65b0\u5efa\u4e00\u4e2a\u8868 customers_auto create table customers_auto( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;id int primary key auto_increment, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_id_name varchar(255), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_id_value varchar(255), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_type varchar(255), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;auto_email varchar(255), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;customers_id [&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-60810","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60810","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=60810"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60810\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}