head.php 와 _head.php 정보
head.php 와 _head.php본문
이 두개의 용도가 어떻게 다른지 왜 두개를 구분해서 쓰는지요.
_head.php파일을 열어봐도 head.php를 인클루드 하는것 밖에는 아무기능도 없는데 왜 다른 파일에서 바로 head.php를 인클루드 하지 않고 _head.php를 인클루드 하는거죠?
이 궁금증은 아래 시그너스님이 알려주신
백마탄환자님의 폼메일 http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=15988 때문에 그러는데요.
이 폼메일을 실행시키면 head.php를 불러오게 되어있죠.
그런데 제가 원하는 페이지에 삽입하려면 head_mail.php을 인클루드 해야 하거든요.
그래서 head.php를 찾아서 head_mail.php로 바꿔줄려고 했더니 head.php는 없구
_head.php만 잔뜩있네요.
이걸 그냥 head_mail.php로 바꿔줘도 괜찮을런지요.
아래파일이 폼메일 파일중 _head.php이 있는 부분 입니다. 이걸 다 바꿔줘도 문제없을까요?
왜 _head.php를 사용하는지 모르겠네요.
아니면 _head_formmail.php라는 파일을 만들어 그 파일이 head_formmail.php를 인클루드 하게 하고 아래의 _head.php를 _head_formmail.php로 바꿔주는게 어떨지... 허접한 제 생각입니다만.
한번 봐주시기를... 주석부분도 무슨소리인지 전혀 모르겠네요.
<?
$g4_another='yes'; //수정要
$g4_dir='g4_another_room'; //위의 줄이 YES면 수정要. 마지막엔 / 슬래쉬 없습니다.
#
####################################################
$g4_now = $_SERVER['PHP_SELF'];
$g4_web = explode("/", $g4_now);
$g4_myname = array_pop($g4_web);
$g4_path_web = implode("/", $g4_web);
$g4_myurl = "http://".$_SERVER['HTTP_HOST'].$g4_path_web."/".$g4_myname;
$PAGE_BASE['www'] = $g4_myurl;
strstr( PHP_OS, "WIN") ? $g4_strPath = "\\" : $g4_str = "/";
$g4_path_file = getcwd ();
$PAGE_BASE['physical'] = $g4_path_file.$g4_str.$g4_myname;
$g4_www = $PAGE_BASE['www'];
$g4_physical = $PAGE_BASE['physical'];
####################################################
// echo "$g4_physical<p>"; // 물절주
// echo "$g4_www<p>"; // 웹절주
$g4_www = explode("/", $g4_www);
$g4_sz = sizeof($g4_www);
$g4_another='yes'; //수정要
$g4_dir='g4_another_room'; //위의 줄이 YES면 수정要. 마지막엔 / 슬래쉬 없습니다.
#
####################################################
$g4_now = $_SERVER['PHP_SELF'];
$g4_web = explode("/", $g4_now);
$g4_myname = array_pop($g4_web);
$g4_path_web = implode("/", $g4_web);
$g4_myurl = "http://".$_SERVER['HTTP_HOST'].$g4_path_web."/".$g4_myname;
$PAGE_BASE['www'] = $g4_myurl;
strstr( PHP_OS, "WIN") ? $g4_strPath = "\\" : $g4_str = "/";
$g4_path_file = getcwd ();
$PAGE_BASE['physical'] = $g4_path_file.$g4_str.$g4_myname;
$g4_www = $PAGE_BASE['www'];
$g4_physical = $PAGE_BASE['physical'];
####################################################
// echo "$g4_physical<p>"; // 물절주
// echo "$g4_www<p>"; // 웹절주
$g4_www = explode("/", $g4_www);
$g4_sz = sizeof($g4_www);
if($g4_another=='YES' && $g4_dir!='')
{$index_file=$g4_dir."/".'index.php';
$_head_file=$g4_dir."/".'_head.php';
$_com_file=$g4_dir."/".'_common.php';
}else
{$index_file='index.php';
$_head_file='_head.php';
$_com_file='_common.php';
}
for($g4_for=0; $g4_sz> $g4_for; $g4_for++){
// 안아프게 배열에...넣어본다.
// echo"$g4_www[$g4_for]</p>";
if(file_exists($index_file)&&file_exists($_head_file)&& file_exists($_com_file))
{ if($g4_for==0) {$g4_sang='.'; break;}
else{$g4_sang=str_replace("index.php","",$index_file);
$g4_sang_length=strlen($g4_sang); //길이를 얻는다.
$g4_sang=substr($g4_sang,0,$g4_sang_length-1);//처음부터 마지막 1자이전까지
break;}
}else{$index_file="../".$index_file;
$_head_file="../".$_head_file;
$_com_file="../".$_com_file;}
}//for
######################################################
#밑의 꺽쇠와 그 다음 걱쇠사이는 공라인이 없어야 됩니다.
#위의 echo step인 물절주등을 테스트하려면 아래의 인클루드 _head.php 를 막으세요.
?>
<?
$g4_path = $g4_sang;
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "메일보내기";
include_once("$g4[path]/_head.php");
##########################################2005.12.10 dalsoo
{$index_file=$g4_dir."/".'index.php';
$_head_file=$g4_dir."/".'_head.php';
$_com_file=$g4_dir."/".'_common.php';
}else
{$index_file='index.php';
$_head_file='_head.php';
$_com_file='_common.php';
}
for($g4_for=0; $g4_sz> $g4_for; $g4_for++){
// 안아프게 배열에...넣어본다.
// echo"$g4_www[$g4_for]</p>";
if(file_exists($index_file)&&file_exists($_head_file)&& file_exists($_com_file))
{ if($g4_for==0) {$g4_sang='.'; break;}
else{$g4_sang=str_replace("index.php","",$index_file);
$g4_sang_length=strlen($g4_sang); //길이를 얻는다.
$g4_sang=substr($g4_sang,0,$g4_sang_length-1);//처음부터 마지막 1자이전까지
break;}
}else{$index_file="../".$index_file;
$_head_file="../".$_head_file;
$_com_file="../".$_com_file;}
}//for
######################################################
#밑의 꺽쇠와 그 다음 걱쇠사이는 공라인이 없어야 됩니다.
#위의 echo step인 물절주등을 테스트하려면 아래의 인클루드 _head.php 를 막으세요.
?>
<?
$g4_path = $g4_sang;
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "메일보내기";
include_once("$g4[path]/_head.php");
##########################################2005.12.10 dalsoo
?>
댓글 전체
이걸 그냥 head_mail.php로 바꿔줘도 괜찮을런지요.
--> 네 바꾸신후 게시판설정에서..
상단 파일 경로에 ../head_mail.php 삽입
--> 네 바꾸신후 게시판설정에서..
상단 파일 경로에 ../head_mail.php 삽입
감사합니다. 그런데 두개를 구분해서 쓰는 이유는.... ㅡㅡ
보안 때문인거 같은데요....
소스를 막기위한 한단계를 더 거치는.. 그런...
소스를 막기위한 한단계를 더 거치는.. 그런...