Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,858 members, 7,956,236 topics. Date: Monday, 23 September 2024 at 08:17 AM |
Nairaland Forum / Science/Technology / Programming / Get Current Page URL In PHP (992 Views)
Get Current Page URL In PHP / How To Change Magento 2 Product Page URL? / Show Image From HTTP URL In React Native (2) (3) (4)
(1) (Reply)
Get Current Page URL In PHP by skptricks: 3:02am On Mar 08, 2018 |
Get more details : Get current page URL in PHP In this tutorial, we are going to discuss how to get current page URL using PHP. $_SERVER is a super global variable, which is always available in all scopes. We will use $_SERVER variable to get the current page URL. It is an array contains various information such as, headers, document path, script location, request method etc. Explanation about some useful $_SERVER variable : $_SERVER['HTTP_HOST'] : Contents of the Host header from the current request, if there is one. $_SERVER['PHP_SELF'] : The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://skptricks.com/post/php-tutorial.php would be /post/php-tutorial.php. $_SERVER['QUERY_STRING'] : If a page is accessed via any query string, $_SERVER['QUERY_STRING'] fetches that query string.This is a actual URL http://localhost/skptricks/check current page url/currentPageURL.php?jj=kkkk after the $_SERVER['QUERY_STRING'] operation would be jj=kkkk . 1 Like
|
(1) (Reply)
Apply: Google Summer For Code Program 2018 For Students (stipends Available) / Bbcode For Yellow Highlight On NL? / Who As A Laptop To Giveout ?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |