{"id":2646,"date":"2018-09-21T13:17:00","date_gmt":"2018-09-21T05:17:00","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=2646"},"modified":"2018-09-21T13:17:00","modified_gmt":"2018-09-21T05:17:00","slug":"php-%e4%bd%bf%e7%94%a8-header-%e5%be%8c%e8%a8%98%e5%be%97%e5%8a%a0exit","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=2646","title":{"rendered":"[ PHP ] &#8211; \u4f7f\u7528 Header() \u5f8c\u8a18\u5f97\u52a0exit()"},"content":{"rendered":"<p>\t\t\t\t\u8981\u8df3\u9801\u6709\u6eff\u591a\u65b9\u5f0f\u7684\uff0c\u4e5f\u5e38\u5e38\u7528\u5230\u6bd4\u5982\u8aaa \u5224\u65b7\u4f60\u662f\u5426\u767b\u5165\uff0c\u5426\u5c31\u8df3\u5230\u767b\u5165\u9801\u9762\uff1b\u6216\u662f\u6c92\u6709\u7a0b\u5f0f\u7684\u57f7\u884c\u6b0a\u9650\u5c31\u8df3\u5230\u9996\u9801\u4e4b\u985e\u7684\u3002<br \/>\n\u6700\u8fd1\u5c31\u56e0\u70ba \u4f7f\u7528 Header()\u4f86\u8df3\u9801\uff0c\u5c31\u662f\u7528\u5728\u5224\u65b7\u6b0a\u9650\uff0c\u8df3\u56de\u53bb\u7684\u90a3\u9801\u53c8\u56e0\u67d0\u9ad4\u689d\u4ef6\u8df3\u56de\u672c\u4f86\u90a3\u9801\u5c31\u7121\u7aae\u8ff4\u5708\u4e86\uff0c\u4e0d\u904e\u73fe\u5728\u7684\u700f\u89bd\u5668\u6703\u81ea\u52d5\u904e\u6ffe\u9019\u7a2e\u72c0\u6cc1\u6240\u4ee5\u4e0d\u6703\u5403\u5149\u4f60\u7684\u8a18\u61b6\u9ad4(\u4ee5\u524d\u7684ie\u5c31\u6703)\uff0c\u4e0d\u904e\u4e5f\u56e0\u70ba\u9019\u6a23\u6211\u5c31\u67e5\u4e0d\u5230\u932f\u8aa4\u78bc\u3002<br \/>\n\u5f8c\u4f86\u624d\u60f3\u5230 Header() \u5f8c\u9762\u7684\u7a0b\u5f0f\u78bc\u5c31\u7b97\u662f\u8df3\u9801\u904e\u53bb\u5176\u5be6\u4ed6\u9084\u662f\u6703\u7e7c\u7e8c\u57f7\u884c\uff0c\u6240\u4ee5\u4e00\u5b9a\u8981\u52a0\u4e0a exit() \u8b93\u4ed6\u4e0d\u57f7\u884c\u5176\u5b83\u7a0b\u5f0f\u3002<br \/>\n<!--more--><br \/>\n[php]<br \/>\nHeader(&quot;location:login.php&quot;);<br \/>\nexit();<br \/>\n[\/php]\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u8df3\u9801\u6709\u6eff\u591a\u65b9\u5f0f\u7684\uff0c\u4e5f\u5e38\u5e38\u7528\u5230\u6bd4\u5982\u8aaa \u5224\u65b7\u4f60\u662f\u5426\u767b&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2201,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[245,295,448,1207],"class_list":["post-2646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-exit","tag-header-2","tag-php","tag-1207","hvn-theme-has-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/2646","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=2646"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/2646\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/media\/2201"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}