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:

$url = $HTTP_SERVER_VARS['HTTP_HOST'] . $HTTP_SERVER_VARS['PHP_SELF'];

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']).

$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];


WEB DESIGN INDIA
42 B Malviya Nagar , New Delhi-110017

Skype: manmeetsi
Email: support.webdesignindia@gmail.com
Tel: 91-011-40502005, 9810067295

 















 


© 2008-2009 dotnet4all.com