메일쓰기 에러나요.. 정보
메일쓰기 에러나요..본문
_DOCTYPE_ Error : Please choose one.
Warning: main(bbs/formmailsend.php) [function.main]: failed to open stream: Permission denied in /home/hanadisplay/public_html/gnu3/index.php on line 246
Warning: main(bbs/formmailsend.php) [function.main]: failed to open stream: Permission denied in /home/hanadisplay/public_html/gnu3/index.php on line 246
Warning: main() [function.include]: Failed opening 'bbs/formmailsend.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/hanadisplay/public_html/gnu3/index.php on line 246
이렇게 나오네요..
아이디는 운영자 아이디라서 모든 권한을 가졌구요..
그리고 보통 팝업창으로 뜨는 메일쓰기말고.. 홈페이지 자체 안에 메일쓰는 페이지를 하나 만들어보려는데
Warning: Unknown(/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php): failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown(/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php): failed to open stream: Permission denied in Unknown on line 0
Warning: (null)() [function.include]: Failed opening '/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php' for inclusion (include_path='.:/usr/local/php/lib/php') in Unknown on line 0
이렇게 뜨네요..
---------------------------------------------------------------------------------------
아래는 제 formmail.php 소스 입니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "STYLE");
$cfg[leftmargin] = $cfg[topmargin] = 0;
if (!$member[mb_id] && $cfg[formail_is_member]) {
echo "<script language='javascript'> alert('Only the members of Hanadisplay can use this service.'); window.close(); </script>";
exit;
}
$html_title = "Send E-Mail";
if ($mb_id) {
$mb = get_member($mb_id);
if ($mb[0] == false) {
echo "<script language='javascript'> alert('ID is invalid.\\n\\nThis ID has possibly been deleted.'); window.close(); </script>";
exit;
}
if ($mb[mb_open] == false && $is_admin != 'default') {
echo "<script language='javascript'> alert('Private Information.'); window.close(); </script>";
exit;
}
// 3.38
// 회원에게 메일을 보내는 경우 메일이 같은지를 검사
if ($mb[mb_email] != $email) {
echo "<script language='javascript'> alert('E-mail addresses are different.'); window.close(); </script>";
exit;
}
}
// 스팸을 발송할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$ss_name = "ss_token";
session_register($ss_name);
$token = md5(uniqid(rand(), true));
$$ss_name = $_SESSION[$ss_name] = $token;
$mb[mb_name] = $name;
$mb[mb_email] = $email;
if (!isset($type)) { $type = 0; }
$type_checked[0] = $type_checked[1] = $type_checked[2] = "";
$type_checked[$type] = "checked";
?>
<img src='image/title_formmail.gif'><br>
<div align=center>
<table width=99% cellpadding=5 cellspacing=0>
<form name=fformmail method=post action="./?doc=bbs/formmailsend.php" enctype="multipart/form-data" onsubmit="return formcheck(this);">
<input type='hidden' name='token' value='<?=$token?>'>
<input type='hidden' name='to' value='<?=$mb[mb_email]?>'>
<input type='hidden' name='attach' value='2'>
<tr>
<td><img src='image/icon_formmail.gif'> Send an E-Mail to <B><?=$mb[mb_name]?></B></td>
</tr>
</table>
<table width=99% cellpadding=1 cellspacing=0 bgcolor=#CCCCCC>
<tr>
<td>
<table width=100% cellpadding=4 cellspacing=0 bgcolor=#FFFFFF>
<? if ($member[mb_id]) { // 회원이면 ?>
<input type='hidden' name='fname' value='<?=$member[mb_name]?>'>
<input type='hidden' name='fmail' value='<?=$member[mb_email]?>'>
<? } else { ?>
<tr><td bgcolor=#F3F3F3 width=60> Name </td><td><input type=text class='input' size='63' name='fname' required minlength=2 itemname='Name'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3 width=60> E-Mail </td><td><input type=text class='input' size='63' name='fmail' required email itemname='E-Mail'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<? } ?>
<tr><td bgcolor=#F3F3F3 width=60> Title </td><td><input type=text class='input' size='63' name='subject' required itemname='Title'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> Select </td><td><input type='radio' name='type' value='0' <?=$type_checked[0]?>> TEXT <input type='radio' name='type' value='1' <?=$type_checked[1]?>> HTML <input type='radio' name='type' value='2' <?=$type_checked[2]?>> TEXT+HTML</td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> Content </td><td><textarea name="content" class='textarea' cols=63 rows='9' required itemname='Content'></textarea></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> File #1</td><td><input type=file class='input' size=50 name='file1'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> File #2</td><td><input type=file class='input' size=50 name='file2'></td></tr>
</table>
</td>
</tr>
</table><br>
<input type=image src='image/btn_send_mail.gif' border=0> <a href="javascript:window.close();"><img src='image/btn_close.gif' border=0></a>
</div>
<script language='javascript'>
function formcheck(f)
{
if (f.file1.value || f.file2.value) {
if (confirm("It will take longer as the sizes of the included files are large.\n\nPlease DO NOT confirm more than twice. Thank you.")) {
return true;
}
} else {
return true;
}
return false;
}
</script>
---------------------------------------------------------------------------------------
아래는 제 formmailsend.php 소스입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "NONE");
// 3.38
// 이전 폼 전송이 같은 도메인에서 온것이 아니라면 차단
if (!preg_match("/^(http|https):\/\/{$_SERVER[HTTP_HOST]}/i", strtolower($_SERVER[HTTP_REFERER]))) {
echo "<script language='javascript'> alert('Please access in valid way.'); window.close(); </script>";
exit;
}
// 3.41
// $_POST 방식으로 폼 값이 넘어오지 않으면 오류
if (!($_POST[to] && $_POST[fname] && $_POST[fmail] && $_POST[subject] && $_POST[content])) {
echo "<script language='javascript'> alert('Values coul not been transffered.'); window.close(); </script>";
exit;
}
// 3.41
// 회원만 사용가능함
if (!$member[mb_id] && $cfg[formail_is_member]) {
echo "<script language='javascript'> alert('Only the members of Hanadisplay can use this service.'); window.close(); </script>";
exit;
}
// 3.41
// 운영자가 아닌 경우 여러 사람에게 메일을 발송할 수 없음
if (!$is_admin) {
if (substr_count($to, '@') > 1) {
echo "<script language='javascript'> alert('You cannot send an E-Mail to many people at once.'); window.close(); </script>";
exit;
}
}
if (!preg_match("/^http[s]?:\/\/".$_SERVER[HTTP_HOST]."/", $_SERVER[HTTP_REFERER]))
alert("Invalid access.");
// 세션에 저장된 토큰과 폼값으로 넘어온 토큰을 비교하여 틀리면 메일을 발송할 수 없다.
$ss_name = "ss_token";
if ($_SESSION[$ss_name] == $_POST["token"] && $_SESSION[$ss_name]) {
// 맞으면 세션을 지워 다시 입력폼을 통해서 들어오도록 한다.
$$ss_name = $_SESSION[$ss_name] = "";
} else {
echo "<script> alert('Error has occurred while sending.'); window.close(); </script>";
exit;
}
$sendmail_count = (int)get_session('ss_sendmail_count') + 1;
if ($sendmail_count > 3) {
echo "<script> alert('You can only send E-Mail few times per sign in.\n\nIf you still want to send an E-Mail, please sign in again.'); window.close(); </script>";
exit;
}
set_session('ss_sendmail_count', $sendmail_count);
$html_title = "Sending E-Mail";
for ($i=1; $i<=$attach; $i++) {
if ($_FILES["file".$i][name]) {
$file[] = attach_file($_FILES["file".$i][name], $_FILES["file".$i][tmp_name]);
}
}
$content = stripslashes($content);
if ($type == 2) {
$type = 1;
$content = preg_replace("/\n/", "<br>", $content);
}
// html 이면
if ($type) {
$current_url = get_current_url();
$mail_content = "<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'><title>Send E-Mail</title><link rel='stylesheet' href='$current_url/style.css' type='text/css'></head><body>$content</body></html>";
} else {
$mail_content = $content;
}
mailer($fname, $fmail, $to, $subject, $mail_content, $type, $file, "EUC-KR");
?>
<script language='javascript'>
alert('E-Mail has successfully been sent.');
window.close();
</script>
대체 뭐가 잘못된건지 알려주세요.. 급합니다 ;
Warning: main(bbs/formmailsend.php) [function.main]: failed to open stream: Permission denied in /home/hanadisplay/public_html/gnu3/index.php on line 246
Warning: main(bbs/formmailsend.php) [function.main]: failed to open stream: Permission denied in /home/hanadisplay/public_html/gnu3/index.php on line 246
Warning: main() [function.include]: Failed opening 'bbs/formmailsend.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/hanadisplay/public_html/gnu3/index.php on line 246
이렇게 나오네요..
아이디는 운영자 아이디라서 모든 권한을 가졌구요..
그리고 보통 팝업창으로 뜨는 메일쓰기말고.. 홈페이지 자체 안에 메일쓰는 페이지를 하나 만들어보려는데
Warning: Unknown(/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php): failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown(/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php): failed to open stream: Permission denied in Unknown on line 0
Warning: (null)() [function.include]: Failed opening '/home/hanadisplay/public_html/gnu3/bbs/formmailsend.php' for inclusion (include_path='.:/usr/local/php/lib/php') in Unknown on line 0
이렇게 뜨네요..
---------------------------------------------------------------------------------------
아래는 제 formmail.php 소스 입니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "STYLE");
$cfg[leftmargin] = $cfg[topmargin] = 0;
if (!$member[mb_id] && $cfg[formail_is_member]) {
echo "<script language='javascript'> alert('Only the members of Hanadisplay can use this service.'); window.close(); </script>";
exit;
}
$html_title = "Send E-Mail";
if ($mb_id) {
$mb = get_member($mb_id);
if ($mb[0] == false) {
echo "<script language='javascript'> alert('ID is invalid.\\n\\nThis ID has possibly been deleted.'); window.close(); </script>";
exit;
}
if ($mb[mb_open] == false && $is_admin != 'default') {
echo "<script language='javascript'> alert('Private Information.'); window.close(); </script>";
exit;
}
// 3.38
// 회원에게 메일을 보내는 경우 메일이 같은지를 검사
if ($mb[mb_email] != $email) {
echo "<script language='javascript'> alert('E-mail addresses are different.'); window.close(); </script>";
exit;
}
}
// 스팸을 발송할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$ss_name = "ss_token";
session_register($ss_name);
$token = md5(uniqid(rand(), true));
$$ss_name = $_SESSION[$ss_name] = $token;
$mb[mb_name] = $name;
$mb[mb_email] = $email;
if (!isset($type)) { $type = 0; }
$type_checked[0] = $type_checked[1] = $type_checked[2] = "";
$type_checked[$type] = "checked";
?>
<img src='image/title_formmail.gif'><br>
<div align=center>
<table width=99% cellpadding=5 cellspacing=0>
<form name=fformmail method=post action="./?doc=bbs/formmailsend.php" enctype="multipart/form-data" onsubmit="return formcheck(this);">
<input type='hidden' name='token' value='<?=$token?>'>
<input type='hidden' name='to' value='<?=$mb[mb_email]?>'>
<input type='hidden' name='attach' value='2'>
<tr>
<td><img src='image/icon_formmail.gif'> Send an E-Mail to <B><?=$mb[mb_name]?></B></td>
</tr>
</table>
<table width=99% cellpadding=1 cellspacing=0 bgcolor=#CCCCCC>
<tr>
<td>
<table width=100% cellpadding=4 cellspacing=0 bgcolor=#FFFFFF>
<? if ($member[mb_id]) { // 회원이면 ?>
<input type='hidden' name='fname' value='<?=$member[mb_name]?>'>
<input type='hidden' name='fmail' value='<?=$member[mb_email]?>'>
<? } else { ?>
<tr><td bgcolor=#F3F3F3 width=60> Name </td><td><input type=text class='input' size='63' name='fname' required minlength=2 itemname='Name'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3 width=60> E-Mail </td><td><input type=text class='input' size='63' name='fmail' required email itemname='E-Mail'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<? } ?>
<tr><td bgcolor=#F3F3F3 width=60> Title </td><td><input type=text class='input' size='63' name='subject' required itemname='Title'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> Select </td><td><input type='radio' name='type' value='0' <?=$type_checked[0]?>> TEXT <input type='radio' name='type' value='1' <?=$type_checked[1]?>> HTML <input type='radio' name='type' value='2' <?=$type_checked[2]?>> TEXT+HTML</td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> Content </td><td><textarea name="content" class='textarea' cols=63 rows='9' required itemname='Content'></textarea></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> File #1</td><td><input type=file class='input' size=50 name='file1'></td></tr>
<tr><td colspan=2 bgcolor=#FFFFFF height=1></td></tr>
<tr><td bgcolor=#F3F3F3> File #2</td><td><input type=file class='input' size=50 name='file2'></td></tr>
</table>
</td>
</tr>
</table><br>
<input type=image src='image/btn_send_mail.gif' border=0> <a href="javascript:window.close();"><img src='image/btn_close.gif' border=0></a>
</div>
<script language='javascript'>
function formcheck(f)
{
if (f.file1.value || f.file2.value) {
if (confirm("It will take longer as the sizes of the included files are large.\n\nPlease DO NOT confirm more than twice. Thank you.")) {
return true;
}
} else {
return true;
}
return false;
}
</script>
---------------------------------------------------------------------------------------
아래는 제 formmailsend.php 소스입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "NONE");
// 3.38
// 이전 폼 전송이 같은 도메인에서 온것이 아니라면 차단
if (!preg_match("/^(http|https):\/\/{$_SERVER[HTTP_HOST]}/i", strtolower($_SERVER[HTTP_REFERER]))) {
echo "<script language='javascript'> alert('Please access in valid way.'); window.close(); </script>";
exit;
}
// 3.41
// $_POST 방식으로 폼 값이 넘어오지 않으면 오류
if (!($_POST[to] && $_POST[fname] && $_POST[fmail] && $_POST[subject] && $_POST[content])) {
echo "<script language='javascript'> alert('Values coul not been transffered.'); window.close(); </script>";
exit;
}
// 3.41
// 회원만 사용가능함
if (!$member[mb_id] && $cfg[formail_is_member]) {
echo "<script language='javascript'> alert('Only the members of Hanadisplay can use this service.'); window.close(); </script>";
exit;
}
// 3.41
// 운영자가 아닌 경우 여러 사람에게 메일을 발송할 수 없음
if (!$is_admin) {
if (substr_count($to, '@') > 1) {
echo "<script language='javascript'> alert('You cannot send an E-Mail to many people at once.'); window.close(); </script>";
exit;
}
}
if (!preg_match("/^http[s]?:\/\/".$_SERVER[HTTP_HOST]."/", $_SERVER[HTTP_REFERER]))
alert("Invalid access.");
// 세션에 저장된 토큰과 폼값으로 넘어온 토큰을 비교하여 틀리면 메일을 발송할 수 없다.
$ss_name = "ss_token";
if ($_SESSION[$ss_name] == $_POST["token"] && $_SESSION[$ss_name]) {
// 맞으면 세션을 지워 다시 입력폼을 통해서 들어오도록 한다.
$$ss_name = $_SESSION[$ss_name] = "";
} else {
echo "<script> alert('Error has occurred while sending.'); window.close(); </script>";
exit;
}
$sendmail_count = (int)get_session('ss_sendmail_count') + 1;
if ($sendmail_count > 3) {
echo "<script> alert('You can only send E-Mail few times per sign in.\n\nIf you still want to send an E-Mail, please sign in again.'); window.close(); </script>";
exit;
}
set_session('ss_sendmail_count', $sendmail_count);
$html_title = "Sending E-Mail";
for ($i=1; $i<=$attach; $i++) {
if ($_FILES["file".$i][name]) {
$file[] = attach_file($_FILES["file".$i][name], $_FILES["file".$i][tmp_name]);
}
}
$content = stripslashes($content);
if ($type == 2) {
$type = 1;
$content = preg_replace("/\n/", "<br>", $content);
}
// html 이면
if ($type) {
$current_url = get_current_url();
$mail_content = "<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'><title>Send E-Mail</title><link rel='stylesheet' href='$current_url/style.css' type='text/css'></head><body>$content</body></html>";
} else {
$mail_content = $content;
}
mailer($fname, $fmail, $to, $subject, $mail_content, $type, $file, "EUC-KR");
?>
<script language='javascript'>
alert('E-Mail has successfully been sent.');
window.close();
</script>
대체 뭐가 잘못된건지 알려주세요.. 급합니다 ;
댓글 전체