PHP Get the Current Page URL
2014-08-29 11:37
239 查看
有时,您可能想要在浏览器中显示当前页面URL网址窗口
将以下代码添加到一个页面:
将以下代码添加到一个页面:
<?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?>调用
<?php echo curPageURL(); ?>
相关文章推荐
- PHP: How to Get the Current Page URL
- Get the self URL of current page
- Use Jquery to get json data from the server-side php page
- PHP Get Current URL
- get current url in current page
- PHP Get Current URL
- How to get the url of a page in OpenERP?
- Get Current URL Attributes in Zend With The Request Object
- [Yii Framework] How to get the current static page name?
- GetPageHTML - Get the HTML code for a given URL
- Get the source code via a url
- API GetCurrentTime After the d1
- Get control name in Page_Load event which make the post back
- Using Timer to get history values from EDNA database, an error is prompted in the page : "Sys.WebForms.PageRequestManagerTimeout
- Get control name in Page_Load event which make the post back
- Sharepoint Error : The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web
- How to get the current epoch time
- How to get parameters from the URL?
- getPageFromURL(string url)
- Get the webpage data from URI.