PHP Get Current URL
程序员文章站
2022-05-31 11:10:13
...
简介:这是PHP Get Current URL的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=346947' scrolling='no'>
Sometimes it is not as straightforward as one may think to get the current url to use it inside your application. Here is a snippet that I use to fetch the current URL and use it in a script. The current url (whether http or https) is now a local variable that you can do with as you please.
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
Note: You should groom this value before using in anything sensitive, like a sql query.
爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具
http://biancheng.dnbcw.info/php/346947.html pageNo:4推荐阅读
-
Php幻术函数学习与应用 _construct() _destruct() _get()等
-
PHP中使用socket方式GET、POST数据实例教程
-
基于curl数据采集之单页面并行采集函数get_htmls的使用_PHP
-
php中运用http调用的GET和POST方法示例_PHP
-
PHP中使用cURL实现Get和Post请求的方法
-
php函数之func_get_args()、func_get_arg()与func_num_args()_PHP教程
-
PHP的学习--解析URL,php--url_PHP教程
-
PHP file_get_contents 结尾出现不可预知字符
-
PHP中使用socket方式GET、POST数据实例_php实例
-
php通过session防url攻击方法