{"id":72,"date":"2013-12-03T03:06:39","date_gmt":"2013-12-02T19:06:39","guid":{"rendered":"http:\/\/www.yptk.cn\/index.php\/2013\/12\/03\/%e5%8d%81%e5%a4%a9%e5%ad%a6%e4%bc%9aphp%e4%b9%8b%e7%ac%ac%e5%8d%81%e5%a4%a9\/"},"modified":"2013-12-03T03:06:39","modified_gmt":"2013-12-02T19:06:39","slug":"%e5%8d%81%e5%a4%a9%e5%ad%a6%e4%bc%9aphp%e4%b9%8b%e7%ac%ac%e5%8d%81%e5%a4%a9","status":"publish","type":"post","link":"http:\/\/yptk.cn\/index.php\/2013\/12\/03\/%e5%8d%81%e5%a4%a9%e5%ad%a6%e4%bc%9aphp%e4%b9%8b%e7%ac%ac%e5%8d%81%e5%a4%a9\/","title":{"rendered":"\u5341\u5929\u5b66\u4f1aphp\u4e4b\u7b2c\u5341\u5929"},"content":{"rendered":"<p><strong style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\u5b66\u4e60\u76ee\u7684\uff1a<\/strong><span style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;background-color:#FBFBFB;\">\u5b66\u4f1a\u7528PHP\u4e0a\u4f20\u6587\u4ef6\u548c\u53d1\u90ae\u4ef6<\/span><\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; \u4e0a\u4f20\u6587\u4ef6\u8868\u5355\u5fc5\u987b\u52a0\u4e0a enctype=&#8221;multipart\/form-data&#8221;&nbsp;<br \/>\n\u548c &lt;input type=&#8221;file&#8221; name=&#8221;file&#8221;&gt;<br \/>\n&nbsp;&nbsp;<strong>\u4e0b\u9762\u770b\u4e00\u4e0b\u4ee3\u7801\uff1a<\/strong>\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; $f=&amp;$HTTP_POST_FILES[&#8216;file&#8217;];<br \/>\n&nbsp; $dest_dir=&#8217;uploads&#8217;;\/\/\u8bbe\u5b9a\u4e0a\u4f20\u76ee\u5f55<br \/>\n&nbsp; $dest=$dest_dir.&#8217;\/&#8217;.date(&#8220;ymd&#8221;).&#8221;_&#8221;.$f[&#8216;name&#8217;];\/\/\u6211\u8fd9\u91cc\u8bbe\u7f6e\u6587\u4ef6\u540d\u4e3a\u65e5\u671f\u52a0\u4e0a\u6587\u4ef6\u540d\u907f\u514d\u91cd\u590d<br \/>\n&nbsp; $r=move_uploaded_file($f[&#8216;tmp_name&#8217;],$dest);<br \/>\n&nbsp; chmod($dest, 0755);\/\/\u8bbe\u5b9a\u4e0a\u4f20\u7684\u6587\u4ef6\u7684\u5c5e\u6027\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; \u4e0a\u4f20\u7684\u6587\u4ef6\u540d\u4e3adate(&#8220;ymd&#8221;).&#8221;_&#8221;.$f[&#8216;name&#8217;] \uff0c\u53ef\u4ee5\u5728\u4ee5\u540e\u63d2\u5165\u5230\u6570\u636e\u5e93\u7684\u65f6\u5019\u7528\u5230\uff0cPHP\u5b9e\u9645\u4e0a\u662f\u628a\u4f60\u4e0a\u4f20\u7684\u6587\u4ef6\u4ece\u4e34\u65f6\u76ee\u5f55\u79fb\u52a8\u5230\u6307\u5b9a\u76ee\u5f55\u3002move_uploaded_file($f[&#8216;tmp_name&#8217;],$dest);\u8fd9\u662f\u5173\u952e\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; \u81f3\u4e8e\u53d1\u90ae\u4ef6\u5c31\u66f4\u52a0\u7b80\u5355\uff0c\u53ef\u4ee5\u4f7f\u7528mail()\u51fd\u6570\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; mail(&#8220;\u6536\u4ef6\u4eba\u5730\u5740&#8221;,&#8221;\u4e3b\u9898&#8221;,&#8221;\u6b63\u6587&#8221;,&#8221;From:\u53d1\u4ef6\u4eba\\r\\nReply-to:\u53d1\u4ef6\u4eba\u7684\u5730\u5740&#8221;);\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; \u4e0d\u8fc7mail()\u9700\u8981\u670d\u52a1\u5668\u7684\u652f\u6301\uff0c\u5728WINDOWS\u4e0b\u8fd8\u9700\u8981\u914d\u7f6eSMTP\u670d\u52a1\u5668\uff0c\u4e00\u822c\u6765\u8bf4\u5916\u9762\u7684LINUX\u7a7a\u95f4\u90fd\u884c\u3002<br \/>\n&nbsp; \u597d\u50cf\u4e0a\u4f20\u6587\u4ef6\u548c\u53d1\u90ae\u4ef6\u6bd4ASP\u7b80\u5355\u5f88\u591a\uff0c\u53ea\u8981\u8c03\u7528\u51fd\u6570\u5c31\u53ef\u4ee5\u4e86\u3002ASP\u8fd8\u9700\u8981\u7528\u5230\u670d\u52a1\u5668\u7684\u4e0d\u540c\u7ec4\u4ef6\u6bd4\u5982FSO\u3001JMAIL\u4ec0\u4e48\u7684\u3002\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp; \u5341\u5929\u5b66\u4f1aPHP\u8bf4\u5230\u8fd9\u91cc\u4e86\uff0c\u6211\u7684\u4e09\u5927\u7cfb\u5217\u6587\u7ae0\u90fd\u7528\u300a\u5341\u5929\u5b66\u4f1a\u300b\u4f5c\u4e3a\u540d\u5b57\uff0c\u60f3\u544a\u8bc9\u5927\u5bb6\u7684\u662fASP,PHP,ASP.NET\u5165\u95e8\u90fd\u53ef\u4ee5\u662f\u5341\u5929\uff0c\u4f46\u662f\u7cbe\u901a\u51b3\u4e0d\u662f\u5341\u5929\u554a\uff0c\u8fd8\u9700\u8981\u5927\u5bb6\u81ea\u5df1\u53bb\u7814\u7a76\u3002\n<\/p>\n<p style=\"font-family:Simsun;font-size:14px;line-height:21.33333396911621px;white-space:normal;\">\n\t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u76ee\u7684\uff1a\u5b66\u4f1a\u7528PHP\u4e0a\u4f20\u6587\u4ef6\u548c\u53d1\u90ae\u4ef6 &nbsp; \u4e0a\u4f20\u6587\u4ef6\u8868\u5355\u5fc5\u987b\u52a0\u4e0a enctype=&#8221;multipart\/form-data&#8221;&nbsp; \u548c &lt;input type=&#8221;file&#8221; name=&#8221;file&#8221;&gt; &nbsp;&nbsp;\u4e0b\u9762\u770b\u4e00\u4e0b\u4ee3\u7801\uff1a &nbsp; $f=&amp;$HTTP_POST_FIL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-15"],"_links":{"self":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":0,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}