게시판에 글이 등록되지 않아요 ㅠㅠ
게시판과 공지사항 등 글 등록이 되지 않습니다.
제가 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;
}
?>
------------------------------------------------------------------------------------------------
진하게 표시한 부분이 열 한번째 줄인데... 절대 모르겠어여
답변 주시면 정말 감사하겠습니다~ㅠㅠ
댓글 2개
19년 전
이런이런
19년 전
mailer.lib.php의 문제라기 보다는 이 파일을 include 해 주는 파일에 문제가 있는듯...
아마도 index.php일텐데 혹시 다른데 mailer 라는 함수가 있는 것은 아닌지 확인 해 보세요..
아마도 index.php일텐데 혹시 다른데 mailer 라는 함수가 있는 것은 아닌지 확인 해 보세요..
게시판 목록
그누3질답
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 15년 전 | 7783 | ||
| 9463 | 18년 전 | 3543 | ||
| 9462 |
kangkiwone
|
18년 전 | 3833 | |
| 9461 |
crushever
|
18년 전 | 3819 | |
| 9460 | 18년 전 | 3931 | ||
| 9459 | 18년 전 | 3535 | ||
| 9458 | 18년 전 | 3377 | ||
| 9457 | 18년 전 | 3520 | ||
| 9456 | 18년 전 | 3375 | ||
| 9455 |
|
18년 전 | 3207 | |
| 9454 | 18년 전 | 3616 | ||
| 9453 | 18년 전 | 3229 | ||
| 9452 | 18년 전 | 3394 | ||
| 9451 | 18년 전 | 3793 | ||
| 9450 | 18년 전 | 3515 | ||
| 9449 | 18년 전 | 3120 | ||
| 9448 | 18년 전 | 4057 | ||
| 9447 |
backbeck
|
18년 전 | 3725 | |
| 9446 | 18년 전 | 3511 | ||
| 9445 | 18년 전 | 3358 | ||
| 9444 | 18년 전 | 3580 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기