Need to know your site’s absolute path right away? Here’s the easy way!
- You will need to copy the function codes below;
<?php
$arr = explode("/",$_SERVER["PATH_TRANSLATED"]);
$file = $arr[count($arr)-1];
$dir = substr($_SERVER["PATH_TRANSLATED"],0,strlen
($_SERVER["PATH_TRANSLATED"])-strlen($file));
echo $dir . "";
?>
- Paste them to a blank notepad, and then save the file as absolute-path.php
- Upload the file absolute-path.php to the place/directory of where you need to know the absolute path.
- Load the http://URL.to/the/absolute-path.php on your browser to view the path! Easy, isn’t it? ;)
Comment?
»
Leave a comment
ajwa . Naj . Wawa . 26 . 











