砍敺 IT_man 2015-7-3 10:55 蝺刻摩 ; K/ \; m0 m- a( [! x( I" W. c
! S/ x7 q" R& M8 D PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER
: ^+ i( }& K1 C- p+ n8 j W$ Y; A6 J' c8 J% g j
$_SERVER['HTTP_HOST']6 P5 O0 f. ~5 @5 S+ k) @
$_SERVER['REQUEST_URI']
0 K% P* q3 F) ^1 U1 H$_SERVER['PHP_SELF']
4 ]4 H4 g$ l5 m8 T9 {% o c3 R: _$_SERVER['QUERY_STRING']7 m; [, T' r0 x
( j8 r, L; A8 Q" T& d. q閮剜蝬脣 http://www.av4u.info/test.php?tid=12
6 N# i' x8 w/ T, B z" W( H9 p( {% K1 Y3 F
隞乩 $_SERVER 仿*蝷箇
6 i6 U5 s7 s% i8 J! f3 i# d: K# V$ ] [0 }
echo $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info
! k- W! t: P- a7 @! O$ wecho $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=12( c* h* Q b9 O0 u
echo $_SERVER['PHP_SELF'];//憿舐內 /test.php! g" [+ w% |$ \' E- f$ J: I
echo $_SERVER['QUERY_STRING'];//憿舐內 tid=12
( Z$ k% M, a6 U3 E& K% E1 A' Q, g8 E. j# A4 q& N
撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
! k, {7 f# L: w9 r, Z2 M4 G9 H, [7 R1 qecho $URL;
6 X8 E- o) A3 j& u; _/ W璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘( M9 p8 Z2 p3 c# H+ M3 Y
' G1 G' |3 @; c5 @. q( R% U- q# ]4 z
0 y2 c8 T' {4 e) L* t- {PHP : $_SERVER - Manual
+ c6 j6 N- c7 _; F6 Mhttp://php.net/manual/en/reserved.variables.server.php2 a2 G1 s! g% t$ h' Z* X& N5 i. |
|
|