게시판에 글이 등록되지 않아요 ㅠㅠ 정보
게시판에 글이 등록되지 않아요 ㅠㅠ첨부파일
본문
게시판과 공지사항 등 글 등록이 되지 않습니다.
제가 PHP는 모르고 그냥 그누보드 설치하는 법만 알고 있어서 에러가 뜨니 너무 난감합니다.
글 등록 버튼을 누르면 다음과 같은 에러가 뜹니다.
Fatal error: Cannot redeclare mailer() in /web/home/teju0/html/lib/mailer.lib.php on line 11
다음은 mailer.lib.php의 내용입니다.
------------------------------------------------------------------------------------------------
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 메일 관련 함수
//==============================================================================
// 메일 관련 함수
//==============================================================================
// 메일 보내기 (파일 여러개 첨부 가능)
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $charset="EUC-KR", $cc="", $bcc="") {
// type : text=0, html=1, text+html=2
$fname = "=?$charset?B?" . base64_encode($fname) . "?=";
$subject = "=?$charset?B?" . base64_encode($subject) . "?=";
$charset = ($charset != "") ? "charset=$charset" : "";
$subject = "=?$charset?B?" . base64_encode($subject) . "?=";
$charset = ($charset != "") ? "charset=$charset" : "";
$header = "Return-Path: <$fmail>\n";
$header .= "From: $fname <$fmail>\n";
$header .= "Reply-To: <$fmail>\n";
if ($cc) $header .= "Cc: $cc\n";
if ($bcc) $header .= "Bcc: $bcc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "X-Mailer: sir mailer 0.9 (sir.co.kr)\n";
$header .= "From: $fname <$fmail>\n";
$header .= "Reply-To: <$fmail>\n";
if ($cc) $header .= "Cc: $cc\n";
if ($bcc) $header .= "Bcc: $bcc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "X-Mailer: sir mailer 0.9 (sir.co.kr)\n";
if ($file != "") {
$boundary = uniqid("http://sir.co.kr/");
$boundary = uniqid("http://sir.co.kr/");
$header .= "Content-type: MULTIPART/MIXED; BOUNDARY=\"$boundary\"\n\n";
$header .= "--$boundary\n";
}
$header .= "--$boundary\n";
}
if ($type) {
$header .= "Content-Type: TEXT/HTML; $charset\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; $charset\n";
$content = stripslashes($content);
}
$header .= "Content-Transfer-Encoding: BASE64\n\n";
$header .= chunk_split(base64_encode($content)) . "\n";
$header .= "Content-Type: TEXT/HTML; $charset\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; $charset\n";
$content = stripslashes($content);
}
$header .= "Content-Transfer-Encoding: BASE64\n\n";
$header .= chunk_split(base64_encode($content)) . "\n";
if ($file != "") {
foreach ($file as $f) {
$header .= "\n--$boundary\n";
$header .= "Content-Type: APPLICATION/OCTET-STREAM; name=\"$f[name]\"\n";
$header .= "Content-Transfer-Encoding: BASE64\n";
$header .= "Content-Disposition: inline; filename=\"$f[name]\"\n";
foreach ($file as $f) {
$header .= "\n--$boundary\n";
$header .= "Content-Type: APPLICATION/OCTET-STREAM; name=\"$f[name]\"\n";
$header .= "Content-Transfer-Encoding: BASE64\n";
$header .= "Content-Disposition: inline; filename=\"$f[name]\"\n";
$header .= "\n";
$header .= chunk_split(base64_encode($f[data]));
$header .= "\n";
}
$header .= "--$boundary--\n";
}
@mail($to, $subject, "", $header);
}
$header .= chunk_split(base64_encode($f[data]));
$header .= "\n";
}
$header .= "--$boundary--\n";
}
@mail($to, $subject, "", $header);
}
// 파일 첨부시
/*
$fp = fopen(__FILE__, "r");
$file[] = array(
"name"=>basename(__FILE__),
"data"=>fread($fp, filesize(__FILE__)));
fclose($fp);
*/
/*
$fp = fopen(__FILE__, "r");
$file[] = array(
"name"=>basename(__FILE__),
"data"=>fread($fp, filesize(__FILE__)));
fclose($fp);
*/
// 파일을 첨부함
function attach_file($filename, $file)
{
$fp = fopen($file, "r");
$tmpfile = array(
"name" => $filename,
"data" => fread($fp, filesize($file)));
fclose($fp);
return $tmpfile;
}
?>
------------------------------------------------------------------------------------------------
function attach_file($filename, $file)
{
$fp = fopen($file, "r");
$tmpfile = array(
"name" => $filename,
"data" => fread($fp, filesize($file)));
fclose($fp);
return $tmpfile;
}
?>
------------------------------------------------------------------------------------------------
진하게 표시한 부분이 열 한번째 줄인데... 절대 모르겠어여
답변 주시면 정말 감사하겠습니다~ㅠㅠ
댓글 전체
이런이런
mailer.lib.php의 문제라기 보다는 이 파일을 include 해 주는 파일에 문제가 있는듯...
아마도 index.php일텐데 혹시 다른데 mailer 라는 함수가 있는 것은 아닌지 확인 해 보세요..
아마도 index.php일텐데 혹시 다른데 mailer 라는 함수가 있는 것은 아닌지 확인 해 보세요..