砍敺 IT_man 2015-7-3 10:55 蝺刻摩
1 K* W6 L; a9 X d5 m; |8 R" _9 |/ G- ^# g$ f
PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER! b `, \3 H4 B5 f. O
; Y- ?: e4 m7 W& r. a! y% s! G$_SERVER['HTTP_HOST']
& o+ Z+ j: j2 q V6 \8 Y, M$_SERVER['REQUEST_URI']- h4 `1 S3 l1 d& n- L+ l
$_SERVER['PHP_SELF']
# n: D9 Z7 b* \* O0 v& R! c$_SERVER['QUERY_STRING']
$ @( W [6 C, p5 i4 D0 X9 b) t7 n% t3 X; O
閮剜蝬脣 http://www.av4u.info/test.php?tid=12( z) l0 o* L) S! |1 G2 X5 E! h* i
7 T; p9 Q0 o( {4 ?, w6 B7 M" ?
隞乩 $_SERVER 仿*蝷箇
# o; }9 z( j* d3 T1 B1 \! ]: R/ x, m! H+ V" N4 ^( U
echo $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info
7 B6 j6 B: f2 J: O$ G. Eecho $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=12( N, m# r3 M" A% g& y
echo $_SERVER['PHP_SELF'];//憿舐內 /test.php) B2 `. i- e0 Q- u) z% P" Y3 b" L
echo $_SERVER['QUERY_STRING'];//憿舐內 tid=120 S( b7 w& b% \& l5 O/ _" T9 L( Z1 m
% |- n* G( P& c' o撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
3 D8 a% F( Y# W4 k" ^. r8 F k' _7 Uecho $URL;
5 `& w% H2 |" k& K1 W' f! S4 c; T& h璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘! Q, z+ ]. E7 ]; f
1 o6 N! {2 n3 U* C- O* C h; z6 \
" r: U1 B' k/ h$ O8 V9 k
PHP : $_SERVER - Manual
- y5 y; |' ?3 W. y# |3 @4 q: Ahttp://php.net/manual/en/reserved.variables.server.php
L8 j5 g8 h$ x% g4 M( y |
|