砍敺 IT_man 2015-7-3 10:55 蝺刻摩 8 I8 r- ]+ e3 Z2 S- e/ ]
" r7 b; w* G8 F' g2 a) W* f' l
PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER& m) U8 d8 {3 t0 i
- F) f4 X* M& o9 Q$_SERVER['HTTP_HOST']
: s! P# q' s& m4 o: N4 u! ?$_SERVER['REQUEST_URI']" _+ G6 X4 k* k$ q, A$ A1 M6 \
$_SERVER['PHP_SELF']
' o* [& B2 b, t* K$_SERVER['QUERY_STRING']: P2 h' V0 q9 c9 P+ q
8 u, |/ R+ `6 H1 a1 [) H3 v0 f閮剜蝬脣 http://www.av4u.info/test.php?tid=12+ S- u3 u) k5 s% P
/ d/ _4 U+ v4 j* e0 Y8 Y7 X隞乩 $_SERVER 仿*蝷箇, o9 C( }3 N$ t
3 c: l3 e$ {; P. d1 j+ i3 o
echo $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info9 l# h& S6 [$ i# |0 R+ n- _
echo $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=12
4 f5 v y, ^1 ^# g& H, g, yecho $_SERVER['PHP_SELF'];//憿舐內 /test.php
1 y5 q" @ y$ ], F5 t* ~echo $_SERVER['QUERY_STRING'];//憿舐內 tid=124 o/ y/ b+ x! y% }$ W1 z" x9 f
e+ E, [6 I: O7 _
撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];- X. h1 a U; d4 Y
echo $URL;/ U- A1 x: x( F" b& W& _
璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘
4 a. _/ o* x6 M5 R1 M5 U
$ N1 Y' H3 `, {5 s$ k% w1 k/ a1 V
PHP : $_SERVER - Manual% A6 `6 `/ o. d& Z
http://php.net/manual/en/reserved.variables.server.php/ A* U1 f- |5 \/ T7 z0 M+ J0 ?
|
|