Jump to: navigation, search

PHP CURRENT URL

From w3cyberlearnings

Contents

PHP CURRENT URL

Get current URL. It returns the path and the file name of the URL.

Example

All get the same results.

<?php
echo $_SERVER['PHP_SELF'];
echo "<br/>";
echo $_SERVER['SCRIPT_NAME'];
echo "<br/>";
?>

Output

/goheme/index.php
/goheme/index.php

Related Links

Manage URL
  1. PHP CURRENT URL
  2. PHP CURRENT HOST
  3. PHP URL Parameters
  4. PHP URL PROTOCOL
  5. PHP URL Script Name
  6. PHP FULL URL
  7. PHP URL Parent Directory
Navigation
Web
SQL
MISC
References