How to find the full URL of the page in PHP in a platform independent and configuration independent way

How to find the full URL of the page in PHP in a platform independent and configuration independent way

Note: This article will be emailed to your friend.

Without much ado, I present the script.
It handles http and https URL’s and should work across platforms and configurations (like using htaccess for clean url’s etc.).
To understand more about the issues involved read - Understanding $_SERVER[’PHP_SELF’], $PHP_SELF, $_SERVER[’REQUEST_URI’] and $_SERVER[’SCRIPT_NAME’] in PHP and when to use what

$_SERVER['FULL_URL'] = ‘http’;
$script_name = ”;
if(isset($_SERVER['REQUEST_URI'])) {
[...]

Read the rest of this article (136 words)

Please fill in the following fields

* - Required

Your Name: *

Your E-Mail: *

Your Remarks:

Friend's Name: *

Friend's E-Mail: *

Protected by Comment Guard Pro