절대경로 표시

상대경로

include "../../../inc/connect.php";

 

절대경로

$root_home_dir="home/myhomepageid/www";

include $root_home_dir."/inc/connect.php";

 

 

절대경로 알아내기

<? 
global $PHP_SELF;

$thisfilename=basename(__FILE__);
$temp_filename=realpath(__FILE__);
if(!$temp_filename) $temp_filename=__FILE__;
$osdir=eregi_replace($thisfilename,"",$temp_filename);
unset($temp_filename);

$virdir = eregi_replace($thisfilename,"",$PHP_SELF);


echo "현재 디렉토리의 절대경로 : ".$osdir."<br>";
echo "현재 디렉토리의 상대 경로 주소 : ".$virdir."<br>";

?>

 

 

<?

//절대경로
 global $PHP_SELF;
 $temp_filename=realpath(__FILE__);
 if(!$temp_filename) $temp_filename=__FILE__;
 $home_path=eregi_replace($PHP_SELF,"",$temp_filename);
 
echo $home_path;

?>



태초에 나는 개그이야기를 만들었다.
내말을 믿고 나를 따르면 천당,
내말을 믿지않고 나를 따르지 않으면 지옥,
나는 하늘나라(우주)에 사느니라.

그럼 난 외계인?