{"id":1988,"date":"2011-04-14T02:21:46","date_gmt":"2011-04-14T02:21:46","guid":{"rendered":"http:\/\/www.icocean.com\/blog\/?p=1988"},"modified":"1970-01-01T07:00:00","modified_gmt":"1970-01-01T07:00:00","slug":"server%E5%87%BD%E6%95%B0%E4%B8%ADquery-string%E5%92%8Crequest-uri%E7%AD%89%E5%9B%9B%E4%B8%AA%E5%8F%98%E9%87%8F%E5%8C%BA%E5%88%AB","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=1988","title":{"rendered":"$_SERVER\u51fd\u6570\u4e2dQUERY_STRING\u548cREQUEST_URI\u7b49\u56db\u4e2a\u53d8\u91cf\u533a\u522b"},"content":{"rendered":"<p>$_SERVER\u5b58\u50a8\u5f53\u524d\u670d\u52a1\u5668\u4fe1\u606f\uff0c\u5176\u4e2d\u6709\u51e0\u4e2a\u503c \u5982$_SERVER[&#8220;QUERY_STRING&#8221;]\uff0c$_SERVER[&#8220;REQUEST_URI&#8221;]\uff0c$_SERVER[&#8220;SCRIPT_NAME&#8221;] \u548c$_SERVER[&#8220;PHP_SELF&#8221;]\u5e38\u5e38\u5bb9\u6613\u6df7\u6dc6\uff0c\u4ee5\u4e0b\u901a\u8fc7\u5b9e\u4f8b\u8be6\u89e3$_SERVER\u51fd\u6570\u4e2d QUERY_STRING\uff0cREQUEST_URI\uff0cSCRIPT_NAME\u548cPHP_SELF\u53d8\u91cf\u533a\u522b\uff0c\u638c\u63e1\u8fd9\u56db\u8005\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u4fbf\u4e8e\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6b63\u786e\u83b7 \u53d6\u6240\u9700\u8981\u7684\u503c\uff0c\u4f9b\u53c2\u8003\u3002&nbsp;&nbsp;<br \/>&nbsp;&nbsp;<br \/>1\uff0c$_SERVER[&#8220;QUERY_STRING&#8221;]&nbsp;&nbsp;<br \/>\u8bf4\u660e\uff1a\u67e5\u8be2(query)\u7684\u5b57\u7b26\u4e32&nbsp;&nbsp;<\/p>\n<p>2\uff0c$_SERVER[&#8220;REQUEST_URI&#8221;]&nbsp;&nbsp;<br \/>\u8bf4\u660e\uff1a\u8bbf\u95ee\u6b64\u9875\u9762\u6240\u9700\u7684URI&nbsp;&nbsp;<\/p>\n<p>3\uff0c$_SERVER[&#8220;SCRIPT_NAME&#8221;]&nbsp;&nbsp;<br \/>\u8bf4\u660e\uff1a\u5305\u542b\u5f53\u524d\u811a\u672c\u7684\u8def\u5f84&nbsp;&nbsp;<\/p>\n<p>4\uff0c$_SERVER[&#8220;PHP_SELF&#8221;]&nbsp;&nbsp;<br \/>\u8bf4\u660e\uff1a\u5f53\u524d\u6b63\u5728\u6267\u884c\u811a\u672c\u7684\u6587\u4ef6\u540d<\/p>\n<p>\u4e3e\u51e0\u4e2a\u5217\u5b50\u5982\u4e0b\uff1a&nbsp;&nbsp;<!--more--><\/p>\n<p>1\uff0chttp:\/\/www.aaaa.com\/ (\u76f4\u63a5\u6253\u5f00\u4e3b\u9875)&nbsp;&nbsp;<\/p>\n<p>\u7ed3\u679c\uff1a&nbsp;&nbsp;<br \/>$_SERVER[&#8220;QUERY_STRING&#8221;] = \u201c\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;REQUEST_URI&#8221;] = \u201c\/\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;SCRIPT_NAME&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;PHP_SELF&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<\/p>\n<p>2\uff0chttp:\/\/www.aaaa.com\/?post=22&nbsp;&nbsp;<\/p>\n<p>\u7ed3\u679c\uff1a&nbsp;&nbsp;<br \/>$_SERVER[&#8220;QUERY_STRING&#8221;] = \u201cpost=22\u2033&nbsp;&nbsp;<br \/>$_SERVER[&#8220;REQUEST_URI&#8221;] = \u201c\/?post=22\u2033&nbsp;&nbsp;<br \/>$_SERVER[&#8220;SCRIPT_NAME&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;PHP_SELF&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<\/p>\n<p>3\uff0chttp:\/\/www.aaaa.com\/index.php?p=222&nbsp;&nbsp;<\/p>\n<p>\u7ed3\u679c\uff1a&nbsp;&nbsp;<br \/>$_SERVER[&#8220;QUERY_STRING&#8221;] = \u201cpost=22\u2033&nbsp;&nbsp;<br \/>$_SERVER[&#8220;REQUEST_URI&#8221;] = \u201c\/index.php?post=22\u2033&nbsp;&nbsp;<br \/>$_SERVER[&#8220;SCRIPT_NAME&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;PHP_SELF&#8221;] = \u201c\/index.php\u201d&nbsp;&nbsp;<br \/>$_SERVER[&#8220;QUERY_STRING&#8221;]\u83b7\u53d6\u67e5\u8be2\u8bed\u53e5\uff0c\u5b9e\u4f8b\u4e2d\u53ef\u77e5\uff0c\u83b7\u53d6\u7684\u662f?\u540e\u9762\u7684\u503c&nbsp;&nbsp;<br \/>$_SERVER[&#8220;REQUEST_URI&#8221;] \u83b7\u53d6http:\/\/www.crazyi.cn\u540e\u9762\u7684\u503c\uff0c\u5305\u62ec\/&nbsp;&nbsp;<br \/>$_SERVER[&#8220;SCRIPT_NAME&#8221;] \u83b7\u53d6\u5f53\u524d\u811a\u672c\u7684\u8def\u5f84\uff0c\u5982\uff1aindex.php&nbsp;&nbsp;<br \/>$_SERVER[&#8220;PHP_SELF&#8221;] \u5f53\u524d\u6b63\u5728\u6267\u884c\u811a\u672c\u7684\u6587\u4ef6\u540d&nbsp;&nbsp;<br \/>\u603b\u7ed3\u4e00\u4e0b\uff0c\u5bf9\u4e8eQUERY_STRING\uff0cREQUEST_URI\uff0cSCRIPT_NAME\u548cPHP_SELF\uff0c\u6df1\u5165\u4e86\u89e3\u5c06\u6709\u5229\u4e8e\u6211\u4eec \u5728$_SERVER\u51fd\u6570\u4e2d\u6b63\u786e\u8c03\u7528\u8fd9\u56db\u4e2a\u503c\u3002\u901a\u8fc7\u5b9e\u4f8b\u8be6\u89e3$_SERVER\u51fd\u6570\u4e2d QUERY_STRING\uff0cREQUEST_URI\uff0cSCRIPT_NAME\u548cPHP_SELF\u638c\u63e1\u56db\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u533a\u522b\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>$_SERVER\u5b58\u50a8\u5f53\u524d\u670d\u52a1\u5668\u4fe1\u606f\uff0c\u5176\u4e2d\u6709\u51e0\u4e2a\u503c \u5982$_SERVER[&#8220;QUERY_STRING&#038; <a href='https:\/\/www.icocean.com\/blog\/?p=1988' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1988","post","type-post","status-publish","format-standard","hentry","category-4","category-4-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1988"}],"version-history":[{"count":0,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1988\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}