{"id":350,"date":"2011-06-25T11:04:04","date_gmt":"2011-06-24T19:04:04","guid":{"rendered":"http:\/\/blog.longwin.com.tw\/?p=350"},"modified":"2011-06-25T11:04:04","modified_gmt":"2011-06-24T19:04:04","slug":"index.html","status":"publish","type":"post","link":"https:\/\/blog.fhl.net\/?p=350","title":{"rendered":"\u88fd\u4f5c\u76ee\u9304\u88e1\u9762\u6a94\u6848\u7d22\u5f15\uff08index.html)\u7684\u5c0f\u7a0b\u5f0f"},"content":{"rendered":"<p>&lt;?php<br \/>\nif ($argc&lt;=1)<br \/>\n&nbsp;{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot; $argc gen_index.php dir_name Error!\\n&quot;;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br \/>\n&nbsp;}<\/p>\n<p>&nbsp; $targetdir=$argv[1];<br \/>\n&nbsp; echo &quot;target=$targetdir \\n&quot;;<br \/>\n&nbsp; $sdp=opendir($targetdir);<br \/>\n&nbsp; $fp=fopen($targetdir.&quot;\/index.html&quot;,&quot;w&quot;);<br \/>\n&nbsp; fwrite($fp,'&lt;html&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=big5&quot;&gt;<br \/>\n&lt;title&gt;Directory List&lt;\/title&gt;&lt;\/head&gt;&lt;body&gt;&#8217;);<br \/>\n&nbsp; while (false!==($file = readdir($sdp))) {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; if ($file != &quot;.&quot; &amp;&amp; $file != &quot;..&quot; &amp;&amp; $file !=&#8217;index.html&#8217;) {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sd=$targetdir.&quot;\/&quot;.$file;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (is_dir($sd))<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system(&quot;php gen_index.php ${targetdir}\/$file&quot;);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp,iconv(&#8216;utf-8&#8242;,&#8217;big5&#8242;,'&lt;a href=&quot;&#8217;.$file.&#8217;\/index.html&quot;&gt;&#8217;.$file.'&lt;\/a&gt;&lt;br\/&gt;&#8217;.&quot;\\n&quot;));<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp,iconv(&#8216;utf-8&#8242;,&#8217;big5&#8242;,'&lt;a href=&quot;&#8217;.$file.&#8217;&quot;&gt;&#8217;.$file.'&lt;\/a&gt;&lt;br\/&gt;&#8217;.&quot;\\n&quot;));<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp; }<br \/>\n&nbsp; fwrite($fp,'&lt;\/body&gt;&lt;\/html&gt;&#8217;);<br \/>\n&nbsp; fclose($fp);<br \/>\n&nbsp; closedir($sdp);<br \/>\n?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;?php if ($argc&lt;=1) &nbsp;{ &nbsp;&nbsp;&nbsp;&#038;nb &hellip; <a href=\"https:\/\/blog.fhl.net\/?p=350\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">\u88fd\u4f5c\u76ee\u9304\u88e1\u9762\u6a94\u6848\u7d22\u5f15\uff08index.html)\u7684\u5c0f\u7a0b\u5f0f<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-e"],"_links":{"self":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=350"}],"version-history":[{"count":0,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=\/wp\/v2\/posts\/350\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fhl.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}