{"id":30760,"date":"2024-11-25T13:08:34","date_gmt":"2024-11-25T05:08:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30760\/"},"modified":"2024-11-25T13:08:34","modified_gmt":"2024-11-25T05:08:34","slug":"dede%e6%80%8e%e4%b9%88%e6%89%b9%e9%87%8f%e5%af%bc%e5%85%a5excel%e6%95%b0%e6%8d%ae%e5%88%b0%e5%90%8e%e5%8f%b0","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30760\/","title":{"rendered":"DEDE\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e0d46a197947579.jpg\" class=\"aligncenter\" title=\"DEDE\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\u63d2\u56fe\" alt=\"DEDE\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>dede\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\uff1f<\/strong><\/p>\n<p><strong>DEDE\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\u6587\u7ae0\u7cfb\u7edf\u7684\u5f00\u53d1\u6559\u7a0b<\/strong><\/p>\n<p>\u5bf9\u4e8e\u4e00\u4e9b\u4f01\u4e1a\u7f51\u7ad9\u6216\u8005\u6dd8\u5b9d\u5ba2\u7c7b\u7f51\u7ad9\u7ecf\u5e38\u4f1a\u9700\u8981\u5c06\u4e00\u4e9bexcel\u7684\u6570\u636e\u6279\u91cf\u5bfc\u5165\u5230\u7f51\u7ad9\uff0c\u901a\u8fc7\u6279\u91cf\u5bfc\u5165\u6765\u8282\u7701\u65f6\u95f4\u800c\u4e0d\u662f\u4ece\u7f51\u7ad9\u540e\u53f0\u4e00\u6761\u4e00\u6761\u7684\u5f55\u5165\u52a0\u6570\u636e\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u611f\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u4eec\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b<\/p>\n<p>&nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u5bf9\u4e8e\u4e00\u4e9b\u4f01\u4e1a\u7f51\u7ad9\u6216\u8005\u6dd8\u5b9d\u5ba2\u7c7b\u7f51\u7ad9\u7ecf\u5e38\u4f1a\u9700\u8981\u5c06\u4e00\u4e9bexcel\u7684\u6570\u636e\u6279\u91cf\u5bfc\u5165\u5230\u7f51\u7ad9\uff0c\u901a\u8fc7\u6279\u91cf\u5bfc\u5165\u6765\u8282\u7701\u65f6\u95f4\u800c\u4e0d\u662f\u4ece\u7f51\u7ad9\u540e\u53f0\u4e00\u6761\u4e00\u6761\u7684\u5f55\u5165\u52a0\u6570\u636e\u3002\u672c\u6559\u7a0b\u5c31\u662f\u4ee5\u628aexcel\u6570\u636e\u5bfc\u5165\u5230\u7ec7\u68a6\u7cfb\u7edf\uff08dedecms)\u4e3a\u4f8b\u5b50\u8fdb\u884c\u6279\u91cf\u6570\u636e\u5bfc\u5165\u7684\u5f00\u53d1\uff0c\u5047\u8bbe\u628aexcel\u6570\u636e\u5bfc\u5165\u5230\u7ec7\u68a6\u4e3b\u8868dede_archives\uff08\u8fd8\u6709\u5fae\u8868\u548c\u9644\u52a0\u8868\uff0c\u8fd9\u91cc\u5c31\u7528\u4e3b\u8868\u4ee3\u8868\u8fd9\u4e09\u4e2a\u8868\uff09\u91cc\u9762\u3002<\/p>\n<p>\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u539f\u7406\uff1a\u901a\u8fc7\u67e5\u8be2excel\uff0c\u628a\u6570\u636e\u4e00\u6761\u4e00\u6761\u7684\u8bfb\u53d6\u51fa\u6765\uff0c\u7136\u540e\uff0c\u901a\u8fc7\u6211\u4eec\u5f00\u53d1\u7684php\u7a0b\u5e8f\u628a\u6570\u636e\u5bfc\u5165\u5230\u8868\u91cc\u9762\u3002<\/p>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u539f\u7406\u6211\u4eec\u77e5\u9053\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5206\u4e3a\u4e24\u90e8\u5206\uff0c\u4e00\u90e8\u5206\u662f\u5f00\u53d1\u51fa\u4eceexcel\u8bfb\u53d6\u6570\u636e\u7684\u7a0b\u5e8f\uff0c\u53e6\u4e00\u90e8\u5206\u662f\u5f00\u53d1\u51fa\u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868dede_archives\u91cc\u9762\u3002<\/p>\n<p>\u4eceexcel\u8bfb\u53d6\u6570\u636e\u7a0b\u5e8f\u5f00\u53d1<\/p>\n<p>\u5176\u5b9e\uff0c\u8fd9\u4e00\u6b65\u6709\u4e00\u4e2a\u8001\u5916\u5df2\u7ecf\u5e2e\u6211\u4eec\u5f00\u53d1\u597d\u4e86\uff0c\u8fd9\u4e2a\u8001\u5916\u5f00\u53d1\u4e86\u4e00\u5957\u4e13\u95e8\u8bfb\u53d6excel\u6570\u636e\u8868\u7684\u7a0b\u5e8f\u53ebPHPExcel\u7c7b\u5e93\u3002<\/p>\n<p>\u8fd9\u4e2aexcel\u7c7b\u5e93\u8fd8\u5305\u62ec\u5176\u5b83\u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u8fd9\u91cc\u4e0d\u4e00\u4e00\u4ecb\u7ecd\uff0c\u60a8\u53ef\u4ee5\u4e0b\u8f7d\u6765\u770b\u770b\uff0c\u8fd9\u91cc\u53ea\u5bf9\u8bfb\u53d6excel\u8fdb\u884c\u8bb2\u89e3\u3002<\/p>\n<p>\u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u4e3b\u8868dede_archives\u91cc\u9762<\/p>\n<p>\u5f53\u901a\u8fc7PHPExcel\u7c7b\u5e93\u91cc\u9762\u63d0\u4f9b\u7684\u7c7b\u8bfb\u53d6\u6570\u636e\u540e\uff0c\u8fd9\u4e00\u6b65\u5c31\u662f\u628a\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868\u91cc\u9762\uff0c\u6240\u4ee5\uff0c\u8fd9\u4e00\u4e2a\u6559\u7a0b\u7684\u5f00\u53d1\u5176\u5b9e\u5c31\u662f\u5728\u5f00\u53d1\u8fd9\u4e00\u90e8\u5206 \uff1b \u628a\u4eceexcel\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u4e3b\u8868\u4e2d\u7684\u7a0b\u5e8f\u5f00\u53d1\u3002<\/p>\n<p>\u4e3a\u4e86\u8bb2\u89e3\u65b9\u4fbf\uff0c\u6211\u4eec\u628a\u63d2\u5165\u6570\u636e\u5e93\u8868\u4e2d\u7684\u6570\u636e\u7684\u6587\u4ef6\u540d\u53eb\u505aexcelinert.php \uff0c\u4e0b\u9762\u5c31\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\u8fdb\u5165\u7a0b\u5e8f\u5f00\u53d1\uff0c\u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868\u4e2d\u3002<\/p>\n<p>\u63d2\u5165\u6570\u636e\u5f00\u53d1\u539f\u7406<\/p>\n<p>1\uff09\u5f00\u53d1\u524d\u7684\u51c6\u5907\uff1a<\/p>\n<p>\u5728excelinsert.php\u91cc\u9762\u52a0\u5165\u4e00\u4e2aheader\u5934\u7684\u7f16\u7801\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u7edf\u4e00\u7f16\u7801\u4ee5\u514d\u51fa\u73b0\u4e71\u7801\uff1aheader(&#8220;Content-type:text\/html;charset=utf8&#8221;);<\/p>\n<p>\u5f15\u5165\u7ec7\u68a6\u7cfb\u7edf\u7684\u516c\u5171\u6587\u4ef6common.inc.php\uff0c\u4e3a\u4ec0\u4e48\u8981\u5f15\u5165\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6211\u4eec\u5728\u63d2\u5165\u6570\u636e\u5e93\u8868\u524d\uff0c\u9996\u9875\u8981\u8fde\u63a5\u7f51\u7ad9\u7684\u6570\u636e\u5e93\uff0c\u5982\u679c\u4e0d\u8fde\u63a5\u5c06\u65e0\u6cd5\u63d2\u5165\u6570\u636e\u5e93\u6570\u636e\u3002\u8981\u6ce8\u610f\uff0c\u5f15\u5165\u6587\u4ef6\u7684\u8def\u5f84\u8981\u6539\u6210\u60a8\u81ea\u5df1\u7684\uff0c\u56e0\u4e3a\uff0c\u6211\u628a\u7ec7\u68a6\u7cfb\u7edf\u5b89\u88c5\u5728\u4e86dedecms\u91cc\u9762\uff0c\u6240\u4ee5\uff0c\u8def\u5f84\u4e2d\u6709\u8fd9\u4e2a\u76ee\u5f55\u540d\u79f0dedecms\uff0c\u5982\u679c\u60a8\u5b89\u88c5\u5728\u6839\u76ee\u5f55\u7684\u8bdd\u5c31\u53bb\u6389\u8fd9\u4e2a\u8def\u5f84\u3002<\/p>\n<p>\u8bbe\u7f6e\u9519\u8bef\u62a5\u544a\u3001\u8bbe\u7f6e\u65f6\u533a\u3001\u8bbe\u7f6e\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4\uff0c\u5f53\u7136\uff0c\u8fd9\u4e2a\u8fd0\u884c\u65f6\u95f4\u53ef\u4ee5\u4e0d\u8bbe\u7f6e\u3001\u8bbe\u7f6ePHPExcel\u7c7b\u7684\u7c7b\u5e93\u5b58\u8def\u5f84\uff0c\u7136\u540e\uff0c\u5f15\u5165IOFactory.php\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u6700\u91cd\u8981\u7684\uff0c\u672c\u529f\u80fd\u5c31\u662f\u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u6765\u5904\u7406\u7684\uff0c\u8fd9\u51e0\u4e2a\u8bbe\u7f6e\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>\u8fd9\u4e9b\u4ee3\u7801\u5168\u662fPHPExcel\u7c7b\u91cc\u9762\u63d0\u4f9b\u7684\uff0c\u6240\u4ee5\uff0c\u8fd9\u91cc\u4e0d\u7528\u591a\u89e3\u91ca\u3002<\/p>\n<p>2) \u5f00\u53d1\u63d2\u5165\u6570\u636e\u4ee3\u7801\uff1a<\/p>\n<p>\u8868\u793a\u901a\u8fc7\u6587\u4ef6excelinert.php\u63d2\u5165excel\u91cc\u9762\u7684\u540d\u79f0\u4e3atest1\u7684\u91cc\u9762\u7684\u6570\u636e\uff0c\u628a\u8fd9\u4e9b\u6570\u636e\u63d2\u5165\u5230\u7ec7\u68a6\u6570\u636e\u5e93\u8868dede_archvies\u91cc\u9762\uff0c\u680f\u76eeid\u4e3a6\u7684\u8868\u4e2d\uff0c\u5176\u4e2d\uff0cdopost=exdata\u8868\u793a\u63d2\u5165\u6570\u636e\u53e3\u4ee4\uff0c\u56e0\u4e3a\uff0c\u4f5c\u4e00\u4e2a\u5224\u65ad\u7684\u8bdd\uff0c\u90a3\u4ec0\u4e48\u4eba\u4e5f\u80fd\u63d2\u5165\u5230\u60a8\u7684\u6570\u636e\u5e93\u8868\u91cc\u9762\u6570\u636e\u4e86\uff0c\u8fd9\u662f\u975e\u5e38\u53ef\u6015\u7684\uff0c\u5c31\u50cf\u4e00\u4e2a\u7f51\u7ad9\u6ca1\u6709\u540e\u53f0\u4e00\u6837\uff0c\u8fd9\u662f\u4e0d\u662f\u975e\u5e38\u53ef\u80fd\u8c01\u90fd\u53ef\u4ee5\u8fdb\u5165\u7f51\u7ad9\u540e\u53f0\u91cc\u9762\uff0c\u540c\u6837\u7684\uff0c\u5982\u679c\u4e0d\u52a0\u8fd9\u4e2a\u53e3\u4ee4\u7684\u8bdd\uff0c\u8c01\u90fd\u53ef\u4ee5\u63d2\u5165\u6570\u636e\uff0c\u8fd9\u662f\u4e0d\u5b89\u5168\u7684\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5728\u63d2\u5165\u6570\u636e\u524d\u5148\u901a\u8fc7$GET\u8d85\u7ea7\u6570\u7ec4\u83b7\u53d6\u5230typeid\u3001do\u548cn\u7684\u503c\uff0c\u7136\u540e\uff0c\u8fdb\u884c\u5bf9\u6bd4\u770b\u770b\u6709\u6ca1\u6709\u6743\u9650\u8fdb\u884c\u63d2\u5165\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u7b2c\u4e00\u4e2a\u5224\u65ad\u5e94\u5f53\u662f\u5224\u65ad\u53e3\u4ee4\u662f\u5426\u6b63\u786e\uff0c\u5982\u679c\u8fd9\u4e2a\u90fd\u4e0d\u6b63\u786e\u7684\u8bdd\uff0c\u5c31\u4e0d\u518d\u5411\u4e0b\u64cd\u4f5c\u4e86\u3002<\/p>\n<p>\u4e3a\u4e86\u8bb2\u89e3\u65b9\u4fbf\uff0c\u4e0b\u9762\u63d0\u4f9bexcelinsert.php\u5f00\u53d1\u5b8c\u6574\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>&lt;?php header(\"Content-type:text\/html;charset=utf8\");\nrequire_once(&#039;\/..\/dedecms\/include\/common.inc.php&#039;);\n  \nerror_reporting(E_ALL);\nset_time_limit(0);\ndate_default_timezone_set(&#039;Europe\/London&#039;);\n\/** Include path **\/\nset_include_path(get_include_path() . PATH_SEPARATOR . &#039;..\/..\/..\/Classes\/&#039;);\n\/** PHPExcel_IOFactory *\/\ninclude &#039;PHPExcel\/IOFactory.php&#039;;\nif(!empty($_GET)){\n    $typeid = $_GET[&#039;typeid&#039;];\n    $dopost = $_GET[&#039;do&#039;];\n    if($dopost == \"exdata\"){\n            if(!empty($_GET[&#039;n&#039;])){\n                $inputFileName = &#039;.\/&#039;.$_GET[&#039;n&#039;].&#039;.xlsx&#039;;\n                $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);\n                $sheetData = $objPHPExcel-&gt;getActiveSheet()-&amp;gt;toArray(null,true,true,true);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowarr=array();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dsql-&amp;gt;Execute('all',\"select&nbsp;bio2,bio1&nbsp;from&nbsp;`dede_addonshop`\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;($rowall&nbsp;=&nbsp;$dsql-&amp;gt;GetArray('all'))&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowarr[]=$rowall;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\nforeach&nbsp;($sheetData&nbsp;as&nbsp;$v)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;($rowarr&nbsp;as&nbsp;$vt)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(in_array($v['B'],$vt)&amp;amp;&amp;amp;$v['A']==$vt['bio1']){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"\u8d27\u53f7\u4e3a\uff1a\".$v['B'].\"&lt;br&gt;\u5382\u5546\u4e3a\uff1a\".$v['A'].\"&lt;br&gt;\u7684\u6570\u636e\u5df2\u5728\u8868\u4e2d\uff0c\u8bf7\u5728excel\u6587\u4ef6\u91cc\u9762\u5220\u9664\u8fd9\u4e00\u6761\u540e\u518d\u6dfb\u52a0\uff01\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u9644\u52a0\u8868\u63d2\u5165\u6570\u636e\u524d\u5904\u7406\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$row&nbsp;=&nbsp;$dsql-&amp;gt;GetOne(\"select&nbsp;aid,bio2&nbsp;from&nbsp;`dede_addonshop`&nbsp;order&nbsp;by&nbsp;aid&nbsp;desc\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!empty($row)){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$aid&nbsp;=&nbsp;$row['aid'];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u627e\u51fa\u6700\u5927\u7684id\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$id&nbsp;=&nbsp;max($aid,$arcid,$tinyid);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$alphalpha&nbsp;=&nbsp;array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM','AN','AO','AP','AQ','AR','AS','AT','AU','AV','AW','AX','AY','AZ');\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u5b57\u6bb5\u6570\u91cf\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fieldnum&nbsp;=&nbsp;count($sheetData[1]);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fields&nbsp;=&nbsp;$fieldvalue&nbsp;=&nbsp;'';\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;($i=0;&nbsp;$i&nbsp;ExecuteNoneQuery($arcquery);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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bsp;\"INSERT&nbsp;INTO&nbsp;`dede_arctiny`(id,typeid,channel,mid,senddate)VALUES&nbsp;('$id','$typeid','6','1','$senddate');\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dsql-&amp;gt;ExecuteNoneQuery($tinyquery);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$num&nbsp;=&nbsp;count($sheetData)-2;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMsg(\"\u606d\u559c\uff0c\u6210\u529f\u63d2\u5165&nbsp;&nbsp;&nbsp;\".$num.\"&nbsp;&nbsp;&nbsp;\u6761\u6570\u636e\uff01\",'javascript:;');\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}else{\n&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"\u5bc6\u7801\u6216\u6587\u4ef6\u540d\u9519\u8bef\uff01\u60a8\u65e0\u6743\u505a\u4efb\u4f55\u64cd\u4f5c\uff01\";\n}\n?&amp;gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b8c\u6574\u7684\u628aexcel\u91cc\u9762\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u4e3b\u8868dede_archives\u91cc\u9762\u7684\u4ee3\u7801\uff0c\u662f\u7ecf\u8fc7\u5b9e\u9645\u6d4b\u8bd5\u7684\u5b8c\u5168\u6ca1\u6709\u95ee\u9898\uff0c\u5982\u679c\u4f60\u505a\u51fa\u6765\u4e0d\u884c\u7684\u8bdd\uff0c\u53ef\u80fd\u662f\u60a8\u5f15\u5165\u7684common.inc.php\u8def\u5f84\u548c\u5f15\u5165\u7684PHPExcel\u7c7b\u5e93Classess\u7c7b\u6709\u95ee\u9898\uff0c\u82e5\u6709\u95ee\u9898\u8bf7\u68c0\u67e5\u8fd9\u4e24\u4e2a\u5730\u65b9\u3002&nbsp;<\/p>\n<p>\u4ee3\u7801\u5206\u6790<\/p>\n<p>1\uff09\u7b2c\u4e00\u6b65\u5148\u5224\u65ad\u95ee\u53f7\u540e\u9762\u662f\u4e0d\u662f\u4e3a\u7a7a\uff0c\u5373dopost=exdata&amp;typeid=6&amp;n=test1\u5b57\u7b26\u4e32\u662f\u5426\u4e3a\u7a7a\uff0c\u5982\u679c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u90fd\u662f\u7a7a\u7684\u8bdd\uff0c\u5176\u5b83\uff0c\u5c31\u4e0d\u7528\u64cd\u4f5c\u4e86\uff0c\u76f4\u63a5\u901a\u8fc7\u51fa\u7a0b\u5e8f\uff0c\u663e\u793a\uff1aecho &#8220;\u5bc6\u7801\u6216\u6587\u4ef6\u540d\u9519\u8bef\uff01\u60a8\u65e0\u6743\u505a\u4efb\u4f55\u64cd\u4f5c\uff01&#8221;;<\/p>\n<p>\u53ea\u6709\u5f53if(!empty($_GET))\u6761\u4ef6\u6210\u7acb\u65f6\uff0c\u624d\u6709\u53ef\u80fd\u8fdb\u5165\u63d2\u5165\u64cd\u4f5c\u3002<\/p>\n<p>\u7136\u540e\uff0c\u83b7\u53d6typeid\u548cdo\u7684\u503c\uff1a<\/p>\n<pre>$typeid&nbsp;=&nbsp;$_GET['typeid'];\n$dopost&nbsp;=&nbsp;$_GET['do'];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u56e0\u4e3a\u4e0b\u9762\u8981\u5bf9\u8981\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868\u4e2d\u6570\u636e\u65f6\u8fd8\u8981\u8fdb\u884c\u53e3\u4ee4\u7684\u5224\u65ad\uff0c\u6240\u4ee5\uff0c\u8fd9\u91cc\u83b7\u53d6do\u7684\u503c\u662f\u5fc5\u987b\u7684\uff0c\u4f46\u662f\uff0c\u8fd9\u91cc\u4e3a\u4ec0\u4e48\u4e00\u8d77\u8981\u83b7\u53d6\u680f\u76eeid\u7684\u503c\u5462\uff1f\u56e0\u4e3a\uff0c\u8fd9\u91cc\u57fa\u672c\u4e0a\u8981\u5230\u6700\u540e\u4e00\u6b65\u624d\u4f7f\u7528\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u7b49\u5230\u4f7f\u7528\u65f6\u518d\u83b7\u53d6\u5462\uff1f\u5982\u679c\u5bc6\u7801\u4e0d\u5bf9\u6216\u5176\u5b83\u539f\u56e0\u7684\u8bdd\uff0c\u4e0d\u80fd\u8fdb\u884c\u63d2\u5165\u64cd\u4f5c\uff0c\u90a3\u4e0d\u662f\u767d\u767d\u83b7\u53d6\u4e86$typeid\u7684\u503c\uff0c\u4ece\u4ee3\u7801\u4f18\u5316\u7684\u89d2\u5ea6\uff0c\u8fd9\u6837\u4e0d\u662f\u6700\u4f18\u7684\uff0c\u4f46\u662f\uff0c\u5927\u5bb6\u8bf7\u6ce8\u610f\uff0c\u56e0\u4e3a\uff0c\u4e0b\u9762\u8981\u5bf9\u83b7\u53d6\u5230\u7684$GET\u7684\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\uff0c\u6240\u4ee5\uff0c\u4e3a\u4e86\u4fdd\u9669\u8d77\u89c1\uff0c\u8fd9\u65f6\u5927\u8fd9\u4e2a\u5730\u65b9\u5148\u83b7\u53d6\u5230\u680f\u76eeid\u7684\u503c\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u5728\u540e\u9762\u51fa\u9519\uff0c\u5f53\u7136\uff0c\u5982\u679c\u60a8\u5728\u5f00\u53d1\u65f6\uff0c\u80fd\u4fdd\u8bc1\u4e0d\u4f1a\u51fa\u9519\u53ef\u4ee5\u5728\u4f7f\u7528$typeid\u65f6\u518d\u83b7\u53d6\u4e5f\u53ef\u4ee5\u3002<\/p>\n<p>\u7136\u540e\uff0c\u5224\u65ad\u53e3\u4ee4\u662f\u5426\u6b63\u786e\uff0c\u5373if($dopost==&#8221;exdata&#8221;)\u662f\u5426\u4e3a\u771f\uff0c\u82e5\u4e3a\u771f\u8bf4\u660e\u6211\u4eec\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u7684\u53e3\u4ee4\u5c31\u662f\u6b63\u786e\u7684\uff0c\u5426\u5219\uff0c\u5c31\u662f\u9519\u8bef\u7684\uff0c\u5982\u679c\u51fa\u9519\u51fa\u9000\u51fa\u7a0b\u5e8f\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c\u3002<\/p>\n<p>\u5982\u679c\u6b63\u786e\uff0c\u5219\u83b7\u53d6n\u7684\u503c\uff0c\u6587\u4ef6excel\u7684\u6587\u4ef6\u540d$inputFileName\u3002<\/p>\n<p>\u7136\u540e\uff0c\u901a\u8fc7PHPExcel\u7c7b\u83b7\u53d6\u5230excel\u6587\u4ef6\u91cc\u9762\u7684\u6570\u636e\u4fdd\u5b58\u5230\u6570\u7ec4$sheetData\u91cc\u9762\u3002<\/p>\n<p>2)\u5224\u65ad\u8981\u63d2\u5165\u7684\u6570\u636e\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u4e8e\u8868dede_addonshop\u91cc\u9762\u3002<\/p>\n<p>\u67e5\u8be2\u9644\u52a0\u8868dede_addonshop\u91cc\u9762\u7684\u5b57\u6bb5bio2,bio1\uff0c\u5e76\u628a\u67e5\u8be2\u51fa\u6765\u7684\u4e00\u7ef4\u6570\u7ec4\u653e\u5230\u4e8c\u7ef4\u6570\u7ec4$rowall\u91cc\u9762\u3002<\/p>\n<p>\u56e0\u4e3a\uff0c\u628a\u4e00\u6761\u6570\u636e\u63d2\u5165\u5230\u7ec7\u68a6\u7cfb\u7edf\u91cc\u9762\u540e\uff0c\u5176\u5b9e\uff0c\u662f\u5728\u7ec7\u68a6\u7684\u4e3b\u8868\u3001\u9644\u52a0\u8868\u548c\u5fae\u8868\u8fdb\u5165\u4e86\u63d2\u5165\u64cd\u4f5c\uff0c\u6240\u4ee5\uff0c\u5728\u63d2\u5165\u524d\u90fd\u8981\u5148\u5224\u65ad\u4e00\u4e0b\u63d2\u5165\u7684\u6570\u636e\u662f\u4e0d\u662f\u5728\u8fd9\u4e09\u4e2a\u8868\u4e2d\u90fd\u5df2\u7ecf\u5b58\u5728\u4e86\uff0c\u5982\u679c\u5df2\u7ecf\u5b58\u5728\u4e86\u5c31\u4e0d\u8981\u8fdb\u5165\u63d2\u5165\u64cd\u4f5c\u4e86\u3002<\/p>\n<p>3\uff09\u63d2\u5165\u6570\u636e\u5e93\u8868\u65f6\u6700\u5927\u6570\u636eid\u7684\u5224\u65ad<\/p>\n<p>\u5f53\u5411\u4e3b\u8868\u6216\u9644\u52a0\u8868\u6216\u5fae\u8868\u52a0\u63d2\u5165\u6570\u636e\u5e93\u524d\uff0c\u8fd8\u8981\u5224\u65ad\u4e00\u4e0b\u8fd9\u65f6\u4e3b\u8868\u6216\u9644\u52a0\u8868\u6216\u5fae\u8868\u91cc\u9762\u6700\u5927\u7684id\uff0c\u628a\u8fd9\u4e2aid\u67e5\u8be2\u51fa\u6765\uff0c\u8fdb\u5165\u5bf9\u6bd4\u5373\uff1a$id = max($aid,$arcid,$tinyid);<\/p>\n<p>\u8fd9\u6837\u5bf9\u6bd4\u4ee5\u540e\u83b7\u53d6\u5230\u7684$id\u7684\u503c\u5c31\u662f\u6700\u5927\u7684\uff0c\u83b7\u53d6\u8fd9\u4e2a\u6700\u5927\u7684$id\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u8fd9\u4e2a$id\u7684\u57fa\u672c\u4e0a\u589e\u52a0$id\uff0c\u4f8b\u5982\uff0c\u5f53\u524d\u8868\u4e2d\u6700\u5927\u7684id\u4e3a9,\u90a3\u4e48\uff0c\u4e0b\u9762\u6211\u4eec\u5728\u63d2\u5165\u6570\u636e\u65f6\u5bf9\u5e94\u7684id\u503c\u5c31\u662f\u4ece10\u5f00\u59cb\uff0c\u8fd9\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u5982\u679c\u4e0d\u505a\u8fd9\u4e2a\u5224\u65ad\uff0c\u90a3\u4e48\uff0c\u5c31\u4f1a\u628a\u539f\u6765\u7684\u6570\u636e\u7ed9\u8986\u76d6\u6389\u3002<\/p>\n<p>3\uff09\u904d\u5386\u6570\u7ec4$sheetData\u63d2\u5165\u6570\u636e<\/p>\n<p>\u56e0\u4e3a\uff0c\u901a\u8fc7PHPExcel\u83b7\u53d6\u5230\u7684\u6570\u636e\u662f\u4fdd\u5b58\u5728$sheetData\u4e8c\u7ef4\u6570\u636e\u91cc\u9762\uff0c\u7c7b\u4f3carray(array(&#8216;a&#8217;,&#8217;b&#8217;),array(&#8216;b&#8217;,&#8217;c&#8217;))\uff0c\u6240\u4ee5\uff0c\u5728\u904d\u5386\u8fd9\u4e2a\u6570\u7ec4\uff0c\u7136\u540e\uff0c\u628a\u8fd9\u4e2a\u6570\u7ec4\u91cc\u9762\u7684\u6570\u636e\u63d2\u5165\u5230\u7ec7\u68a6\u7684\u4e3b\u8868\u3001\u5fae\u8868\u548c\u9644\u52a0\u8868\u91cc\u9762\u3002<\/p>\n<p>\u8fd9\u91cc\u8981\u6ce8\u610f$id = $id+1\uff0c\u8fd9\u884c\u4ee3\u7801\u4e3a\u4ec0\u4e48\u8981\u505a\u8fd9\u884c\u4ee3\u7801\uff0c\u662f\u56e0\u4e3a\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u884c\u4ee3\u7801\u90a3\u4e48\uff0c\u5728\u63d2\u5165\u6570\u636e\u65f6id\u7684\u503c\u4e00\u76f4\u662f\u540c\u4e00\u4e2a\uff0c\u4f8b\u5982\uff0c$id=9\uff0c\u8fd9\u6837\u4e00\u76f4\u662f9\uff0c\u8fd9\u662f\u4e0d\u53ef\u80fd\u7684\uff0c\u56e0\u4e3a\uff0c\u4e00\u4e2a\u7f51\u7ad9\u9762\u7684\u6bcf\u4e00\u7bc7\u6587\u7ae0\u7684id\u90fd\u662f\u4e0d\u540c\u7684\uff0c\u5982\u679c\u5168\u4e00\u6837\u7684\u8bdd\uff0c\u53ef\u80fd\u7f51\u7ad9\u91cc\u9762\u663e\u793a\u6570\u636e\u5c31\u53ea\u6709\u4e00\u6761\u4e86\uff0c\u5176\u5b83\u7684\u5168\u90e8\u88ab\u8986\u76d6\u6389\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fDEDE\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>dede\u600e\u4e48\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\uff1f DEDE\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5230\u540e\u53f0\u6587\u7ae0\u7cfb\u7edf\u7684\u5f00\u53d1\u6559\u7a0b \u5bf9\u4e8e\u4e00\u4e9b\u4f01\u4e1a\u7f51\u7ad9\u6216\u8005\u6dd8\u5b9d\u5ba2\u7c7b\u7f51\u7ad9\u7ecf\u5e38\u4f1a\u9700\u8981\u5c06\u4e00\u4e9bexcel\u7684\u6570\u636e\u6279\u91cf\u5bfc\u5165\u5230\u7f51\u7ad9\uff0c\u901a\u8fc7\u6279\u91cf\u5bfc\u5165\u6765\u8282\u7701\u65f6\u95f4\u800c\u4e0d\u662f\u4ece\u7f51\u7ad9\u540e\u53f0\u4e00\u6761\u4e00\u6761\u7684\u5f55\u5165\u52a0\u6570\u636e\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u611f\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u4eec\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b &nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a \u5bf9\u4e8e\u4e00\u4e9b\u4f01\u4e1a\u7f51\u7ad9\u6216\u8005\u6dd8\u5b9d\u5ba2\u7c7b\u7f51\u7ad9\u7ecf\u5e38\u4f1a\u9700\u8981\u5c06\u4e00\u4e9bexcel\u7684\u6570\u636e\u6279\u91cf\u5bfc\u5165\u5230\u7f51\u7ad9\uff0c\u901a\u8fc7\u6279\u91cf\u5bfc\u5165\u6765\u8282\u7701\u65f6\u95f4\u800c\u4e0d\u662f\u4ece\u7f51\u7ad9\u540e\u53f0\u4e00\u6761\u4e00\u6761\u7684\u5f55\u5165\u52a0\u6570\u636e\u3002\u672c\u6559\u7a0b\u5c31\u662f\u4ee5\u628aexcel\u6570\u636e\u5bfc\u5165\u5230\u7ec7\u68a6\u7cfb\u7edf\uff08dedecms)\u4e3a\u4f8b\u5b50\u8fdb\u884c\u6279\u91cf\u6570\u636e\u5bfc\u5165\u7684\u5f00\u53d1\uff0c\u5047\u8bbe\u628aexcel\u6570\u636e\u5bfc\u5165\u5230\u7ec7\u68a6\u4e3b\u8868dede_archives\uff08\u8fd8\u6709\u5fae\u8868\u548c\u9644\u52a0\u8868\uff0c\u8fd9\u91cc\u5c31\u7528\u4e3b\u8868\u4ee3\u8868\u8fd9\u4e09\u4e2a\u8868\uff09\u91cc\u9762\u3002 \u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u539f\u7406\uff1a\u901a\u8fc7\u67e5\u8be2excel\uff0c\u628a\u6570\u636e\u4e00\u6761\u4e00\u6761\u7684\u8bfb\u53d6\u51fa\u6765\uff0c\u7136\u540e\uff0c\u901a\u8fc7\u6211\u4eec\u5f00\u53d1\u7684php\u7a0b\u5e8f\u628a\u6570\u636e\u5bfc\u5165\u5230\u8868\u91cc\u9762\u3002 \u901a\u8fc7\u4e0a\u9762\u7684\u539f\u7406\u6211\u4eec\u77e5\u9053\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u6279\u91cf\u5bfc\u5165excel\u6570\u636e\u5206\u4e3a\u4e24\u90e8\u5206\uff0c\u4e00\u90e8\u5206\u662f\u5f00\u53d1\u51fa\u4eceexcel\u8bfb\u53d6\u6570\u636e\u7684\u7a0b\u5e8f\uff0c\u53e6\u4e00\u90e8\u5206\u662f\u5f00\u53d1\u51fa\u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868dede_archives\u91cc\u9762\u3002 \u4eceexcel\u8bfb\u53d6\u6570\u636e\u7a0b\u5e8f\u5f00\u53d1 \u5176\u5b9e\uff0c\u8fd9\u4e00\u6b65\u6709\u4e00\u4e2a\u8001\u5916\u5df2\u7ecf\u5e2e\u6211\u4eec\u5f00\u53d1\u597d\u4e86\uff0c\u8fd9\u4e2a\u8001\u5916\u5f00\u53d1\u4e86\u4e00\u5957\u4e13\u95e8\u8bfb\u53d6excel\u6570\u636e\u8868\u7684\u7a0b\u5e8f\u53ebPHPExcel\u7c7b\u5e93\u3002 \u8fd9\u4e2aexcel\u7c7b\u5e93\u8fd8\u5305\u62ec\u5176\u5b83\u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u8fd9\u91cc\u4e0d\u4e00\u4e00\u4ecb\u7ecd\uff0c\u60a8\u53ef\u4ee5\u4e0b\u8f7d\u6765\u770b\u770b\uff0c\u8fd9\u91cc\u53ea\u5bf9\u8bfb\u53d6excel\u8fdb\u884c\u8bb2\u89e3\u3002 \u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u4e3b\u8868dede_archives\u91cc\u9762 \u5f53\u901a\u8fc7PHPExcel\u7c7b\u5e93\u91cc\u9762\u63d0\u4f9b\u7684\u7c7b\u8bfb\u53d6\u6570\u636e\u540e\uff0c\u8fd9\u4e00\u6b65\u5c31\u662f\u628a\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868\u91cc\u9762\uff0c\u6240\u4ee5\uff0c\u8fd9\u4e00\u4e2a\u6559\u7a0b\u7684\u5f00\u53d1\u5176\u5b9e\u5c31\u662f\u5728\u5f00\u53d1\u8fd9\u4e00\u90e8\u5206 \uff1b \u628a\u4eceexcel\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u4e3b\u8868\u4e2d\u7684\u7a0b\u5e8f\u5f00\u53d1\u3002 \u4e3a\u4e86\u8bb2\u89e3\u65b9\u4fbf\uff0c\u6211\u4eec\u628a\u63d2\u5165\u6570\u636e\u5e93\u8868\u4e2d\u7684\u6570\u636e\u7684\u6587\u4ef6\u540d\u53eb\u505aexcelinert.php \uff0c\u4e0b\u9762\u5c31\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\u8fdb\u5165\u7a0b\u5e8f\u5f00\u53d1\uff0c\u628a\u8bfb\u53d6\u51fa\u6765\u7684\u6570\u636e\u63d2\u5165\u5230\u6570\u636e\u5e93\u8868\u4e2d\u3002 \u63d2\u5165\u6570\u636e\u5f00\u53d1\u539f\u7406 1\uff09\u5f00\u53d1\u524d\u7684\u51c6\u5907\uff1a \u5728excelinsert.php\u91cc\u9762\u52a0\u5165\u4e00\u4e2aheader\u5934\u7684\u7f16\u7801\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u7edf\u4e00\u7f16\u7801\u4ee5\u514d\u51fa\u73b0\u4e71\u7801\uff1aheader(&#8220;Content-type:text\/html;charset=utf8&#8221;); \u5f15\u5165\u7ec7\u68a6\u7cfb\u7edf\u7684\u516c\u5171\u6587\u4ef6common.inc.php\uff0c\u4e3a\u4ec0\u4e48\u8981\u5f15\u5165\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6211\u4eec\u5728\u63d2\u5165\u6570\u636e\u5e93\u8868\u524d\uff0c\u9996\u9875\u8981\u8fde\u63a5\u7f51\u7ad9\u7684\u6570\u636e\u5e93\uff0c\u5982\u679c\u4e0d\u8fde\u63a5\u5c06\u65e0\u6cd5\u63d2\u5165\u6570\u636e\u5e93\u6570\u636e\u3002\u8981\u6ce8\u610f\uff0c\u5f15\u5165\u6587\u4ef6\u7684\u8def\u5f84\u8981\u6539\u6210\u60a8\u81ea\u5df1\u7684\uff0c\u56e0\u4e3a\uff0c\u6211\u628a\u7ec7\u68a6\u7cfb\u7edf\u5b89\u88c5\u5728\u4e86dedecms\u91cc\u9762\uff0c\u6240\u4ee5\uff0c\u8def\u5f84\u4e2d\u6709\u8fd9\u4e2a\u76ee\u5f55\u540d\u79f0dedecms\uff0c\u5982\u679c\u60a8\u5b89\u88c5\u5728\u6839\u76ee\u5f55\u7684\u8bdd\u5c31\u53bb\u6389\u8fd9\u4e2a\u8def\u5f84\u3002 \u8bbe\u7f6e\u9519\u8bef\u62a5\u544a\u3001\u8bbe\u7f6e\u65f6\u533a\u3001\u8bbe\u7f6e\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4\uff0c\u5f53\u7136\uff0c\u8fd9\u4e2a\u8fd0\u884c\u65f6\u95f4\u53ef\u4ee5\u4e0d\u8bbe\u7f6e\u3001\u8bbe\u7f6ePHPExcel\u7c7b\u7684\u7c7b\u5e93\u5b58\u8def\u5f84\uff0c\u7136\u540e\uff0c\u5f15\u5165IOFactory.php\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u6700\u91cd\u8981\u7684\uff0c\u672c\u529f\u80fd\u5c31\u662f\u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u6765\u5904\u7406\u7684\uff0c\u8fd9\u51e0\u4e2a\u8bbe\u7f6e\u4ee3\u7801\u5982\u4e0b\uff1a \u8fd9\u4e9b\u4ee3\u7801\u5168\u662fPHPExcel\u7c7b\u91cc\u9762\u63d0\u4f9b\u7684\uff0c\u6240\u4ee5\uff0c\u8fd9\u91cc\u4e0d\u7528\u591a\u89e3\u91ca\u3002 2) \u5f00\u53d1\u63d2\u5165\u6570\u636e\u4ee3\u7801\uff1a \u8868\u793a\u901a\u8fc7\u6587\u4ef6excelinert.php\u63d2\u5165excel\u91cc\u9762\u7684\u540d\u79f0\u4e3atest1\u7684\u91cc\u9762\u7684\u6570\u636e\uff0c\u628a\u8fd9\u4e9b\u6570\u636e\u63d2\u5165\u5230\u7ec7\u68a6\u6570\u636e\u5e93\u8868dede_archvies\u91cc\u9762\uff0c\u680f\u76eeid\u4e3a6\u7684\u8868\u4e2d\uff0c\u5176\u4e2d\uff0cdopost=exdata\u8868\u793a\u63d2\u5165\u6570\u636e\u53e3\u4ee4\uff0c\u56e0\u4e3a\uff0c\u4f5c\u4e00\u4e2a\u5224\u65ad\u7684\u8bdd\uff0c\u90a3\u4ec0\u4e48\u4eba\u4e5f\u80fd\u63d2\u5165\u5230\u60a8\u7684\u6570\u636e\u5e93\u8868\u91cc\u9762\u6570\u636e\u4e86\uff0c\u8fd9\u662f\u975e\u5e38\u53ef\u6015\u7684\uff0c\u5c31\u50cf\u4e00\u4e2a\u7f51\u7ad9\u6ca1\u6709\u540e\u53f0\u4e00\u6837\uff0c\u8fd9\u662f\u4e0d\u662f\u975e\u5e38\u53ef\u80fd\u8c01\u90fd\u53ef\u4ee5\u8fdb\u5165\u7f51\u7ad9\u540e\u53f0\u91cc\u9762\uff0c\u540c\u6837\u7684\uff0c\u5982\u679c\u4e0d\u52a0\u8fd9\u4e2a\u53e3\u4ee4\u7684\u8bdd\uff0c\u8c01\u90fd\u53ef\u4ee5\u63d2\u5165\u6570\u636e\uff0c\u8fd9\u662f\u4e0d\u5b89\u5168\u7684\u3002 \u6240\u4ee5\uff0c\u5728\u63d2\u5165\u6570\u636e\u524d\u5148\u901a\u8fc7$GET\u8d85\u7ea7\u6570\u7ec4\u83b7\u53d6\u5230typeid\u3001do\u548cn\u7684\u503c\uff0c\u7136\u540e\uff0c\u8fdb\u884c\u5bf9\u6bd4\u770b\u770b\u6709\u6ca1\u6709\u6743\u9650\u8fdb\u884c\u63d2\u5165\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u7b2c\u4e00\u4e2a\u5224\u65ad\u5e94\u5f53\u662f\u5224\u65ad\u53e3\u4ee4\u662f\u5426\u6b63\u786e\uff0c\u5982\u679c\u8fd9\u4e2a\u90fd\u4e0d\u6b63\u786e\u7684\u8bdd\uff0c\u5c31\u4e0d\u518d\u5411\u4e0b\u64cd\u4f5c\u4e86\u3002 \u4e3a\u4e86\u8bb2\u89e3\u65b9\u4fbf\uff0c\u4e0b\u9762\u63d0\u4f9bexcelinsert.php\u5f00\u53d1\u5b8c\u6574\u7684\u4ee3\u7801\uff1a &lt;?php header(&#8220;Content-type:text\/html;charset=utf8&#8221;); require_once(&#039;\/..\/dedecms\/include\/common.inc.php&#039;); error_reporting(E_ALL); set_time_limit(0); date_default_timezone_set(&#039;Europe\/London&#039;); \/** Include path **\/ set_include_path(get_include_path() . PATH_SEPARATOR . &#039;..\/..\/..\/Classes\/&#039;); \/** PHPExcel_IOFactory *\/ include &#039;PHPExcel\/IOFactory.php&#039;; if(!empty($_GET)){ $typeid = $_GET[&#039;typeid&#039;]; $dopost = $_GET[&#039;do&#039;]; if($dopost [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-30760","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30760","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=30760"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30760\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}