砍敺 IT_man 2015-7-3 10:55 蝺刻摩 : S: G5 |& @' F6 q% J" m8 n
% f+ d, Q8 x9 X6 B8 y1 S8 ~9 u
PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER+ y# _. L( k, z5 o8 S
C/ W. y1 w8 {/ _6 N$_SERVER['HTTP_HOST']. q" b3 r! \- d- ]7 l% d& u$ Z+ K
$_SERVER['REQUEST_URI']
) i2 m% m# ]; b( W+ @$_SERVER['PHP_SELF']
2 t+ e4 ~" f2 @% L. ^$_SERVER['QUERY_STRING'] ?5 t& @ c B( R- W! T8 x/ y
$ ~5 T- G0 k1 C+ @* o% i+ v9 H
閮剜蝬脣 http://www.av4u.info/test.php?tid=12+ b+ w8 y: Z/ {1 _! v* `6 Y
" q* j4 w; k: f; \隞乩 $_SERVER 仿*蝷箇
; [# n2 ?& J: e: k, [2 f3 O5 J7 I f) D
echo $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info
& i) j3 e: S3 I% c$ Xecho $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=12
, v$ k6 d. G, u8 necho $_SERVER['PHP_SELF'];//憿舐內 /test.php/ V% v$ e8 T l$ Z* b8 j: P, @
echo $_SERVER['QUERY_STRING'];//憿舐內 tid=12
1 M) K1 k, J5 u/ I
) U; w9 {7 [5 {( [% j$ @& Y撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];5 o2 h! C2 \+ @2 {0 s0 P
echo $URL;
% W! s* B" f3 H( m5 \璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘; Y6 `) f6 q- R. u& q& O L: h% r
& C1 f- u! D. s7 x2 o. h( O5 y! t) _4 |$ l- c) y6 H
PHP : $_SERVER - Manual7 R; Z% W$ f, u- h: f$ v1 b
http://php.net/manual/en/reserved.variables.server.php
( Z g! K2 q$ |6 o) f) e, _ |
|