묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
폼메일이 안 되어서 도움을 요청합니다.
2003.04.02 20:12
메일이 안 보내어져서 이렇게 도움을 요청합니다.
mail2.php가 아래처럼 이렇게 되어있고 그 밑에 mail2_end.php가 있습니다.
Parse error: parse error, unexpected T_STRING in /home/word/public_html/mail2_end.php on line 10
그런데 이렇게 에러가 뜹니다.
제가 급하거든요.
그럼 도움을 부탁드립니다.
^^
감사합니다.
행복하세요...
mail2.php 가
<html>
<head>
<script language='javascript'>
function sendmail()
{
if(document.mail.to.value == "")
alert("주소");
else if(document.mail.from.value == "")
alert("자신매일");
else if(document.mail.subject.value == "")
alert("제목");
else if(document.mail.content.value == "")
alert("내용");
else document.mail.submit();
}
</script>
<title> php world -mailer</title>
</head>
<body bgcolor=eeeeee>
<center><font size=6 face='comic sans ms'>form mail</font><br>
<form name=mail method=post action='mail2_end.php'>
<table width=550 cellspacing=1 bgcolor=black>
<tr>
<td align=center bgcolor=999999 width=20%>
<font size=2 color=000000 >받는자</td>
<td bgcolor=eeeeee width=80%><input type=text name=to size=50></td>
<tr>
<tr>
<td align=center bgcolor=999999 ><font size=2 color=white>보내는 사람</font></td>
<td bgcolor=eeeeee><input type=text name=from size=50></td>
</tr>
<tr>
<td align=center bgcolor=999999><font size=2 color=white>제목</font></td>
<td bgcolor=eeeeee><input type=text name=subject size=50></td>
</tr>
<tr>
<td align=center bgcolor=999999> <font size=2 color=white>내용</font>
</td>
<td bgcolor=eeeeee><textarea name=content rows=12 cols=52>
</textarea></td>
</tr>
<tr>
<td align=center bgcolor=999999><font size=2 color=white>첨부파일 </font></td>
<td bgcolor=eeeeee> <input type=file name=upfile></td>
</tr>
</table>
<table width=500>
<tr>
<td height=5 align=center><input type=button value='메일발송' onclick='sendmail()'>
<input type=button value='+ '+ '취소' onclick='self.window.close();'></td>
</tr>
</table>
</form>
</body>
</html>
mail2_end.php
// 첨부파일 체크...
if ($upfile && $upfile_size)
{
//파일함수를 이용하내용을 $file에저장
$filename=basename($upfile_name);
$result=fopen($upfile,"r"); <= 에러부분
$file=fread($result,$upfile_size);
fclose($result);
//타입
$upfile_type = "application/octet-stream";
$boundary = "--------" . uniqid("part");
$headers . = "mime-version: 1.0rn";
$headers . = "content-type: multipart/mixed;
boundary="$boundary"";
//메세지
$body .= "this is a multi-part message in mime format.rnrn";
$body .= "--$boundaryrn";
$body .= "content-type: text/html; charset=euc-krrn";
$body .= "content-transfer-encoding: 8bitrnrn";
$body .= "nl2br(stripslashes($content)) . "rnrn";
$body .= "nl2br(stripslashes($phpworld) . "rnrn";
$body .= "--$boundaryrn";
//파일
$body .= "content-type: $upfile_type; name="$filename"rn";
$body .= "content-transfer-encoding: base64rnrn";
$body .= ereg_replace("(.{80})","\1rn",base64_encode($file));
}
else
{
// 첨부된 파일없을때...
$body =stripslashes($content)."rnrn";
}
mail($to,$subject,$body,$headers);
echo "
<html>
<head>
<script language='javascript'>
function cc()
{
settimeout('window.close()',3000);
}
</script>
</head>
<body onload='cc();'bgcolor=eeeeee>
<table width=100%>
<tr>
<td height=280 valign=middle align=center><font size=2 color=blue>매일발송하였습니다.</font></td>
</tr>
</table>
</body>
</html>";
?>
mail2.php가 아래처럼 이렇게 되어있고 그 밑에 mail2_end.php가 있습니다.
Parse error: parse error, unexpected T_STRING in /home/word/public_html/mail2_end.php on line 10
그런데 이렇게 에러가 뜹니다.
제가 급하거든요.
그럼 도움을 부탁드립니다.
^^
감사합니다.
행복하세요...
mail2.php 가
<html>
<head>
<script language='javascript'>
function sendmail()
{
if(document.mail.to.value == "")
alert("주소");
else if(document.mail.from.value == "")
alert("자신매일");
else if(document.mail.subject.value == "")
alert("제목");
else if(document.mail.content.value == "")
alert("내용");
else document.mail.submit();
}
</script>
<title> php world -mailer</title>
</head>
<body bgcolor=eeeeee>
<center><font size=6 face='comic sans ms'>form mail</font><br>
<form name=mail method=post action='mail2_end.php'>
<table width=550 cellspacing=1 bgcolor=black>
<tr>
<td align=center bgcolor=999999 width=20%>
<font size=2 color=000000 >받는자</td>
<td bgcolor=eeeeee width=80%><input type=text name=to size=50></td>
<tr>
<tr>
<td align=center bgcolor=999999 ><font size=2 color=white>보내는 사람</font></td>
<td bgcolor=eeeeee><input type=text name=from size=50></td>
</tr>
<tr>
<td align=center bgcolor=999999><font size=2 color=white>제목</font></td>
<td bgcolor=eeeeee><input type=text name=subject size=50></td>
</tr>
<tr>
<td align=center bgcolor=999999> <font size=2 color=white>내용</font>
</td>
<td bgcolor=eeeeee><textarea name=content rows=12 cols=52>
</textarea></td>
</tr>
<tr>
<td align=center bgcolor=999999><font size=2 color=white>첨부파일 </font></td>
<td bgcolor=eeeeee> <input type=file name=upfile></td>
</tr>
</table>
<table width=500>
<tr>
<td height=5 align=center><input type=button value='메일발송' onclick='sendmail()'>
<input type=button value='+ '+ '취소' onclick='self.window.close();'></td>
</tr>
</table>
</form>
</body>
</html>
mail2_end.php
// 첨부파일 체크...
if ($upfile && $upfile_size)
{
//파일함수를 이용하내용을 $file에저장
$filename=basename($upfile_name);
$result=fopen($upfile,"r"); <= 에러부분
$file=fread($result,$upfile_size);
fclose($result);
//타입
$upfile_type = "application/octet-stream";
$boundary = "--------" . uniqid("part");
$headers . = "mime-version: 1.0rn";
$headers . = "content-type: multipart/mixed;
boundary="$boundary"";
//메세지
$body .= "this is a multi-part message in mime format.rnrn";
$body .= "--$boundaryrn";
$body .= "content-type: text/html; charset=euc-krrn";
$body .= "content-transfer-encoding: 8bitrnrn";
$body .= "nl2br(stripslashes($content)) . "rnrn";
$body .= "nl2br(stripslashes($phpworld) . "rnrn";
$body .= "--$boundaryrn";
//파일
$body .= "content-type: $upfile_type; name="$filename"rn";
$body .= "content-transfer-encoding: base64rnrn";
$body .= ereg_replace("(.{80})","\1rn",base64_encode($file));
}
else
{
// 첨부된 파일없을때...
$body =stripslashes($content)."rnrn";
}
mail($to,$subject,$body,$headers);
echo "
<html>
<head>
<script language='javascript'>
function cc()
{
settimeout('window.close()',3000);
}
</script>
</head>
<body onload='cc();'bgcolor=eeeeee>
<table width=100%>
<tr>
<td height=280 valign=middle align=center><font size=2 color=blue>매일발송하였습니다.</font></td>
</tr>
</table>
</body>
</html>";
?>