砍敺 IT_man 2015-7-3 10:55 蝺刻摩
7 U& Q+ |- O3 r1 q- m; y" }. Q6 ^5 N/ B
PHP 銝剖敺桀蝬脣孵臭誑 $_SERVER 蝯孵敺嚗璅孵蝔敺格暺暻餌抬銝雿輻刻絲靘蝞貊嗥陛殷擐靘隤霅撟曉撣貊典啁 $_SERVER
/ K* _; l) O* J2 p( [
% x) j0 q0 T* O% r$_SERVER['HTTP_HOST']
$ F3 a( R! q& I9 R# C+ n2 g$_SERVER['REQUEST_URI']% `$ {8 v* P- M" {- f
$_SERVER['PHP_SELF']; C3 d0 z- n7 ]7 q1 Q8 H7 G4 V
$_SERVER['QUERY_STRING']% z2 O: Y& m5 q" M+ k
& I7 n# M: X. B5 P9 m
閮剜蝬脣 http://www.av4u.info/test.php?tid=12$ N1 g, q8 q" ^' C- t& b# U
! r% h0 p2 T/ V9 E8 {4 n. F隞乩 $_SERVER 仿*蝷箇
- H+ _! a0 b* k- i. Y
7 i( e) f& x3 c, Y4 Iecho $_SERVER['HTTP_HOST'];//憿舐內 www.av4u.info& Z" l' i8 v% Y0 J! i4 Q- x
echo $_SERVER['REQUEST_URI'];//憿舐內 /test.php?tid=12
6 o q3 Y7 R1 Z/ u1 T0 w; Lecho $_SERVER['PHP_SELF'];//憿舐內 /test.php: P8 w# _3 L- ?- {! b
echo $_SERVER['QUERY_STRING'];//憿舐內 tid=12* g* {3 } O& D; }% G
* H+ _& S+ C6 N# F) ^% i$ _$ Y, b
撟曉 $_SERVER嚗撌脩敺鈭蝬脣典嚗亥撠望舀蝬脣蝯衣韏瑚$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
6 E8 R3 O9 m3 b" _echo $URL;
% d- Y& e, N$ [7 |8 {, t璅撠勗臭誑拙敺曉函蝬脣嚗芣臬蝪∪桃蝭靘撌莎憒蝬脣蝯瑽頛箄嚗臭誑隤輻冽游 $_SERVER 靘敺閰喟敦典嚗隢 php.net $_SERVER 隞蝝嫘2 D: y0 f% _( s# P
& R; t$ }( B# e) Y) t; j+ \" a5 m
4 _$ L8 v, w& [( s. Q2 v* sPHP : $_SERVER - Manual L- i0 j! ?6 Y, X
http://php.net/manual/en/reserved.variables.server.php( W+ J+ Y( ~! H$ p
|
|