Blogger Information
Blog 7
fans 0
comment 0
visits 4696
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
cookie实现登陆---0420
李昊文叔叔的博客
Original
621 people have browsed it

//返回当前主机名 即localhost
echo $_SERVER['HTTP_HOST'].'<br>';

/*当我们使用$_SERVER['PHP_SELF']的时候,无论访问的URL地址是否有index.php,它都会自动的返回 index.php.
但是如果在文件名后面再加斜线的话,就会把后面所有的内容都返回在$_SERVER['PHP_SELF']。*/
//放在函数htmlentities ()会更安全
echo $_SERVER['PHP_SELF'].'<br>';

/*$_SERVER['REQUEST_URI']返回的是我们在URL里写的精确的地址,如果URL只写到”/”,就返回 “/”*/
echo $_SERVER['REQUEST_URI'].'<br>';

//在所有的返回中都是当前的文件名/example/index.php
echo $_SERVER['SCRIPT_NAME'];



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post