PHP How To Show Full Script Path Directory Folder Path

Mobile
feeds
Welcome Login | Register

PHP How To Show Full Script Path Directory Folder Path
  Forums Index
      » PHP Forums
        » » PHP how to show full script path directory folder path



PHP How To Show Full Script Path Directory Folder Path
Post Description:
Post Tags: php, how, to, show, full, script, path, directory, folder, path, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 1725 Times Since Wed Feb 06, 2008 9:27 am Posted By hostman with 0 replies
PHP How To Show Full Script Path Directory Folder Path
im putting this post here to remember this important function to show the full path of a script, i use this to display the path of my install script so that i know where the user is installing their script.

CODE
$script_filename = getenv('PATH_TRANSLATED');
if (empty($script_filename)) {
	$script_filename = getenv('SCRIPT_FILENAME');
}
	$script_filename = str_replace('', '/', $script_filename);
	$script_filename = str_replace('//', '/', $script_filename);
	$dir_fs_www_root_array = explode('/', dirname($script_filename));
	$dir_fs_www_root = array();
	for ($i=0, $n=sizeof($dir_fs_www_root_array)-1; $i<$n; $i++) {
		$dir_fs_www_root[] = $dir_fs_www_root_array[$i];
	}
$dir_fs_www_root = implode('/', $dir_fs_www_root) . '/'; 


to show it in your html, just put this:

PHP CODE:
<?php echo $dir_fs_www_root . 'install/myfile.sql'; ?>



Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About PHP How To Show Full Script Path Directory Folder Path




(0) Comments