Website Design United States, Website Design California, Website Designing United States, Website Designing California

Obtaining the full path - PHP

PHP does not have a direct way to get the full path to where the code is being run from, but it can be created with the soruce code listed here.

It should be noted that source code listed work with PHP version 4.1.0 and newer. Previous versions should use the following code:


If you need just the path and not the actual page that's running this code then you can omit the . $_SERVER['PHP_SELF'] (or . $HTTP_SERVER_VARS['PHP_SELF']).


42 B Malviya Nagar , New Delhi-110017

Skype: manmeetsi
Tel: 91-011-40502005, 9810067295



© 2008-2009