砍敺 IT_man 2015-7-3 10:55 蝺刻摩 3 y; C% Q' R1 j( \: A! H
) P/ r2 t" \0 |9 @( M$ g z
PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER' B0 `8 D. U; I7 l
9 a) b% P }4 I- \6 J7 H4 d& |$_SERVER['HTTP_HOST']8 Z Z3 u, ?( n% U, x( x0 Y
$_SERVER['REQUEST_URI']
! y( | c2 R2 I$_SERVER['PHP_SELF']
% k; z I! `* k) s7 a9 K) d$_SERVER['QUERY_STRING']
. e+ e1 a1 N0 t: o* j+ I) @: r
" |( w# R9 D3 k8 z& ]: {8 h閮剜蝬脣 http://www.av4u.info/test.php?tid=12$ c7 `' n( o8 \7 M6 O# ]1 Y
6 z" ~1 }) t6 W1 t隞乩 $_SERVER 仿*蝷箇% ]' h- g, F3 E0 T d* q& N# y
0 O0 x- a4 P) L+ t mecho $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info
- n9 Q0 B" o6 l& w2 C3 Gecho $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=122 i* k6 H9 [7 p" ~
echo $_SERVER['PHP_SELF'];//憿舐內 /test.php
7 S* ` s" t- V1 wecho $_SERVER['QUERY_STRING'];//憿舐內 tid=12
3 U u& w- A/ q* X$ w2 p+ H; l
3 u$ _1 ^* ]& t0 A0 u, D+ g- ^撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
( {5 z4 D3 r$ Z; V. h! F& B D/ lecho $URL;
7 F. N7 X, T$ u4 V3 m9 _4 X: x璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘5 `% X6 V' g4 ^% G3 {$ s
9 D- _5 [7 D# k- b4 b0 O% b3 s! _& U9 N
PHP : $_SERVER - Manual. ~! [7 g+ M# g& t/ u; C, x! w
http://php.net/manual/en/reserved.variables.server.php
% z# F- a- c' W0 x" d8 ~; a8 Y |
|