common.php 252라인질문 드려요!
아래 코드 보면 $dbconfig_file = "dbconfig.php"; 이런 내용이 있는데
왜 php파일을 일반파일로 만드는 걸까요?
그냥 php파일을 사용해도 되지 않을까요?
보안에 관계된 걸까요?
별것 아닌것 같기도 하지만 괜히 궁금증이 발동 하네요!
$dbconfig_file = "dbconfig.php";
if (file_exists("$g4[path]/$dbconfig_file"))
{
if (is_dir("$g4[path]/install")) die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script type='text/javascript'> alert('install 디렉토리를 삭제하여야 정상 실행됩니다.'); </script>");
include_once("$g4[path]/$dbconfig_file");
$connect_db = sql_connect($mysql_host, $mysql_user, $mysql_password);
$select_db = sql_select_db($mysql_db, $connect_db);
if (!$select_db)
die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script type='text/javascript'> alert('DB 접속 오류'); </script>");
}
왜 php파일을 일반파일로 만드는 걸까요?
그냥 php파일을 사용해도 되지 않을까요?
보안에 관계된 걸까요?
별것 아닌것 같기도 하지만 괜히 궁금증이 발동 하네요!
$dbconfig_file = "dbconfig.php";
if (file_exists("$g4[path]/$dbconfig_file"))
{
if (is_dir("$g4[path]/install")) die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script type='text/javascript'> alert('install 디렉토리를 삭제하여야 정상 실행됩니다.'); </script>");
include_once("$g4[path]/$dbconfig_file");
$connect_db = sql_connect($mysql_host, $mysql_user, $mysql_password);
$select_db = sql_select_db($mysql_db, $connect_db);
if (!$select_db)
die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script type='text/javascript'> alert('DB 접속 오류'); </script>");
}
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 5개
dbconfig.php 에 들어있는 db정보를 가지고오는 것같은데..
파일이 없다면 에러창띄우고..
그냥 그뿐..??
첫줄 $dbconfig_file = "dbconfig.php"; 을 얘기 하는것입니다.
잘못 이해하신듯하네요. 이건 그냥 경로와 파일명만 변수에 담아두는 것뿐입니다.
일반적으로 그노보드를 사용하면 dbconfig.php를 사용한다고 인식하게 되는데
이것이 불안하신분은 디렉토리에서 dbconfig.php를 abcd.php 같은 다른 이름을 설정하였을때
common.php에서 dbconfig.php를 abcd.php로 한번만 바꾸면 아래쪽에서 dbconfig.php를 계속하여 바꾸지 않고 사용할수 있기 때문인것 같습니다.
보안을 위해서 dbconnents.php 파일을 삭제하고 common.php 로 대체한다는 2005년 내용이 있군요...