How to get current page URL in PHP?

You can use PHP $SERVER variable for getting current page URL. Being super global variable you will get access to $SERVER in any part of PHP application.
Below is a sample script getting the URL of the current page in PHP

You may find these articles helpful:


Editorial Staff

Editorial Staff at tutsplanet is a dedicated team to write various tutorial articles.