{"id":763,"date":"2016-01-27T12:01:17","date_gmt":"2016-01-27T04:01:17","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=763"},"modified":"2016-01-27T12:01:17","modified_gmt":"2016-01-27T04:01:17","slug":"php-%e5%93%8e%e5%91%80%e6%88%91%e7%9a%84%e5%aa%bd-%e5%a5%bd%e4%ba%8b%e5%a4%9a%e8%b3%bc%e7%b6%b2-%e6%90%9c%e5%b0%8b-%e5%a4%b1%e8%83%bd%ef%bc%9f%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=763","title":{"rendered":"[ PHP ] &#8211; \u54ce\u5440\u6211\u7684\u5abd \u597d\u4e8b\u591a\u7db2\u8cfc \u641c\u5c0b \u5931\u80fd\uff1f\uff01"},"content":{"rendered":"<p>\t\t\t\t\u54ce\u5440\u6211\u7684\u5abd \u597d\u4e8b\u591a\u7db2\u8cfc \u641c\u5c0b \u5931\u80fd\uff1f\uff01<br \/>\n\u6700\u8fd1\u7db2\u8def\u8cfc\u7269\u754c\u7684\u5927\u4e8b\u4e0d\u5916\u4e4e\u662f costco \u7dda\u4e0a\u8cfc\u7269\u958b\u8ce3\uff0c\u521d\u90e8\u5f9e\u754c\u9762\u4e0a\u4f86\u770b\u611f\u89ba\u9084ok\uff1b<br \/>\n\u4f46\u662f \u91cd\u9ede\u5c31\u662f\u9019\u500b\u4f46\u662f\uff0c\u7522\u54c1\u67e5\u8a62\u529f\u80fd\u662f\u600e\u9ebc\u6703\u4e8b\uff1f \u95dc\u9375\u5b57\u6211\u6253 \u201c\u8212\u6f54\u885b\u751f\u7d19\u201c<br \/>\n\u67e5\u8a62\u7d50\u679c \u53ea\u6709\u7b2c\u9805\u7522\u54c1\u7b26\u5408 \u5176\u5b83\u7684\u7522\u54c1 \u53ea\u6709\u662f\u6709 \u8212\u7684 \u6f54\u7684 \u885b\u7684 \u751f\u7684 \u7d19\u7684 \u7d71\u7d71\u7d66\u6211\u8dd1\u51fa\u4f86<br \/>\n\u771f\u7684\u662f\u770b\u5230\u9b3c\uff0c\u8eab\u70ba\u7db2\u8def\u5de5\u7a0b\u5e2b\u5c31\u89ba\u5f97\u9019\u7a2e\u8a2d\u8a08\u5f88\u602a\uff1b<br \/>\n\u4ee5google\u4f86\u8aaa \u95dc\u9375\u5b57 \u6253 \u8212\u6f54 \u51fa\u4f86\u7684\u4e00\u5b9a\u662f \u5305\u542b \u8212\u6f54 \u5169\u500b\u5b57\u7684\u67e5\u8a62\u7d50\u679c\uff0c<br \/>\n\u82e5\u6253 \u8212\u6f54\u885b\u751f\u7d19 \u6e96\u78ba\u7387\u4e00\u5b9a\u662f\u5927\u5e45\u63d0\u5347<br \/>\n\u82e5\u518d\u627e\u4e0d\u5230 \u4f60\u53ef\u4ee5\u6253 \u8212\u6f54 \u885b\u751f\u7d19 \u5c07\u95dc\u9375\u5b57\u62c6\u6210\u5169\u500b\u4e2d\u9593\u7559\u500b\u7a7a\u767d \u9019\u6a23\u5c31\u53ef\u63d0\u5347 \u67e5\u8a62\u7d50\u679c\u7684\u91cf \u4f46\u6703\u964d\u4f4e\u6e96\u78ba\u5ea6<br \/>\n\u800c costco \u7dda\u4e0a\u8cfc\u7269 \u5f88\u660e\u986f\u7684\u662f\u628a \u8212\u6f54\u885b\u751f\u7d19 \u6bcf\u500b\u5b57\u90fd\u62c6\u958b\u4f86\u7576\u95dc\u9375\u5b57\uff0c<br \/>\n\u67e5\u8a62\u7d50\u679c\u5c31\u7206\u91cf \u6e96\u78ba\u7387\u4e5f\u4f4e\u5230\u7206 \u540c\u6642\u4e5f\u88ab\u4eba\u7f75\u5230\u7ffb\u6389\u3002<br \/>\n\u7576\u6211\u5728\u505a\u7522\u54c1\u95dc\u9375\u5b57\u67e5\u8a62\u529f\u80fd\u6642\u6211\u6703\u4ee5 \u7a7a\u767d\u7576\u5207\u5272\u9ede \u8b93\u4f7f\u7528\u8005\u53ef\u8f38\u5165\u591a\u7d44\u95dc\u9375\u5b57<br \/>\n[php]<br \/>\nif($key!=&#8221;){<br \/>\n\t\t$key_ay=explode(&#8216; &#8216;, $key);\/\/\u4f9d\u7a7a\u767d\u5206\u5272\u4f7f\u7528\u8005\u6240\u8f38\u5165\u7684\u95dc\u9375\u5b57<br \/>\n\t\tif(!empty($key[0])){<br \/>\n\t\t\tforeach ( $key_ay as $row){<br \/>\n\t\t\t  $all_key.=&quot; or product_subject like &#8216;%&quot;.$row.&quot;%&#8217;<br \/>\n\t\t\t\tor product_content like &#8216;%&quot;.$row.&quot;%&#8217;<br \/>\n\t\t\t\tor product_tag like&#8217;%&quot;.$row.&quot;%&#8217;<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t\t$search.=&quot; and ( 1=2 $all_key )&quot;;\/\/\u56e0\u4e0a\u65b9sql\u8a9e\u6cd5\u524d\u9762\u90fd\u662f or \u6240\u4ee5 \u524d\u65b9\u4e00\u5b9a\u8981\u52a0 1=2(\u6c38\u4e0d\u6210\u7acb)\u624d\u80fd\u6b63\u5e38\u641c\u5c0b<br \/>\n\t}<br \/>\n[\/php]<br \/>\n\u4ee5\u4e0a\u5c31\u53ef\u91dd\u5c0d \u7522\u54c1\u540d\u7a31 \u7522\u54c1\u5167\u5bb9\u6558\u8ff0 \u7522\u54c1\u95dc\u9375\u5b57 \u505a\u67e5\u8a62\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u54ce\u5440\u6211\u7684\u5abd \u597d\u4e8b\u591a\u7db2\u8cfc \u641c\u5c0b \u5931\u80fd\uff1f\uff01 \u6700\u8fd1\u7db2\u8def\u8cfc&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-763","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=763"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}