PHP how to show full script path directory folder path
RegisterLogin
PHP how to show full script path directory folder path
Post Description: PHP how to show full script path directory folder path
Tags: PHP, how, to, show, full, script, path, directory, folder, path
This Post Was Posted On Feb 29, 2008 By web hosting #1285
Post Description: PHP how to show full script path directory folder path
Tags: PHP, how, to, show, full, script, path, directory, folder, path
This Post Was Posted On Feb 29, 2008 By web hosting #1285
PHP how to show full script path directory folder path by web hosting
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
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Fri Dec 23, 2011 12:32 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3