{"id":2833,"date":"2024-11-10T08:27:20","date_gmt":"2024-11-10T00:27:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2833\/"},"modified":"2024-11-10T08:27:20","modified_gmt":"2024-11-10T00:27:20","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-php-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e6%88%aa%e5%8f%96-referer-%e5%92%8c-username-%e4%b9%8b%e9%97%b4%e7%9a%84%e9%83%a8%e5%88%86%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2833\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 PHP \u6b63\u5219\u8868\u8fbe\u5f0f\u622a\u53d6 &#038;referer= \u548c &#038;username \u4e4b\u95f4\u7684\u90e8\u5206\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173088938319023.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 PHP \u6b63\u5219\u8868\u8fbe\u5f0f\u622a\u53d6 &#038;referer= \u548c &#038;username \u4e4b\u95f4\u7684\u90e8\u5206\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 PHP \u6b63\u5219\u8868\u8fbe\u5f0f\u622a\u53d6 &#038;referer= \u548c &#038;username \u4e4b\u95f4\u7684\u90e8\u5206\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 php \u6b63\u5219\u622a\u53d6 &amp;referer= \u548c &amp;username \u4e4b\u95f4\u7684\u90e8\u5206<\/strong><\/p>\n<p>php \u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\u622a\u53d6\u6307\u5b9a\u5185\u5bb9\uff1a<\/p>\n<ol>\n<li>\u5339\u914d &amp;referer= \u7684\u4f4d\u7f6e\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f preg_match(&#8216;\/&amp;referer=(.*?)&amp;username\/&#8217;, $url)\u3002<\/li>\n<li>\u5982\u679c\u5339\u914d\u6210\u529f\uff0c\u4f7f\u7528 $matches[1] \u83b7\u53d6\u5339\u914d\u5230\u7684\u503c\u3002<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b\u4ee3\u7801\uff1a<\/strong><\/p>\n<pre>$url = 'web.admin.com\/admin\/userManage\/investuser?start=2018-01-02%2000:00:00&amp;end=2018-01-02%2010:41:46&amp;itype=3&amp;isfirst=3&amp;referer=http:\/\/testhf.irongbei.com\/MUserRegister\/register2?v=10f454&amp;key=311bcdec754052e40fe025a54f488f9a&amp;rbref=rbzc&amp;isShow=&amp;username=&amp;pname=&amp;plattype=0&amp;istatus=1&amp;buy_type=0&amp;channel_source=62';\n\nif (preg_match('\/&amp;referer=(.*?)&amp;username\/', $url, $matches)) {\n    echo $matches[1];\n} else {\n    echo 'URL \u4e0d\u6b63\u786e\uff0c\u65e0\u6cd5\u5339\u914d\u3002';\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 PHP \u6b63\u5219\u8868\u8fbe\u5f0f\u622a\u53d6 &amp;referer= \u548c &amp;username \u4e4b\u95f4\u7684\u90e8\u5206\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 php \u6b63\u5219\u622a\u53d6 &amp;referer= \u548c &amp;username \u4e4b\u95f4\u7684\u90e8\u5206 php \u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\u622a\u53d6\u6307\u5b9a\u5185\u5bb9\uff1a \u5339\u914d &amp;referer= \u7684\u4f4d\u7f6e\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f preg_match(&#8216;\/&amp;referer=(.*?)&amp;username\/&#8217;, $url)\u3002 \u5982\u679c\u5339\u914d\u6210\u529f\uff0c\u4f7f\u7528 $matches[1] \u83b7\u53d6\u5339\u914d\u5230\u7684\u503c\u3002 \u793a\u4f8b\u4ee3\u7801\uff1a $url = &#8216;web.admin.com\/admin\/userManage\/investuser?start=2018-01-02%2000:00:00&amp;end=2018-01-02%2010:41:46&amp;itype=3&amp;isfirst=3&amp;referer=http:\/\/testhf.irongbei.com\/MUserRegister\/register2?v=10f454&amp;key=311bcdec754052e40fe025a54f488f9a&amp;rbref=rbzc&amp;isShow=&amp;username=&amp;pname=&amp;plattype=0&amp;istatus=1&amp;buy_type=0&amp;channel_source=62&#8217;; if (preg_match(&#8216;\/&amp;referer=(.*?)&amp;username\/&#8217;, $url, $matches)) { echo $matches[1]; } else { echo &#8216;URL \u4e0d\u6b63\u786e\uff0c\u65e0\u6cd5\u5339\u914d\u3002&#8217;; } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 PHP \u6b63\u5219\u8868\u8fbe\u5f0f\u622a\u53d6 &amp;referer= \u548c &amp;username \u4e4b\u95f4\u7684\u90e8\u5206\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2833","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=2833"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2833\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}