묻고답하기
폼메일을 설치하려고...
2009.01.30 15:51
게시판의글
http://www.zeroboard.com/?mid=zb4_tip&page=10&sort_index=readed_count&order_type=desc&document_srl=850148
을 토대로 작업했습니다.
테스트로 http://www.digiloguemind.com/bbs/na_mail/index.php 로 입력하니
Parse error: syntax error, unexpected T_VARIABLE in /home/zalcom/public_html/bbs/na_mail/index.php on line 22
뜨는데 무엇이 잘못된거죠?
고수님들의 조언 부탁드립니다.
아래는
index.php입니다.
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=euc-kr'>
<STYLE TYPE="text/css">
<!--
A:link {text-decoration:none; color:darkblue}
A:visited{text-decoration:none; color:663399}
A:hover {text-decoration:none; color:red}
A:active {text-decoration:none; color:red}
td {font-size:9pt}
-->
</STYLE>
</head>
<body bgcolor='#FFFFFF' leftmargin="5" marginwidth="5" topmargin="5" marginheight="5">
<?
$_zb_url="www.digiloguemind.com/bbs/";
$_zb_path = "/home/zalcom/public_html/bbs/";
include $_zb_path."outlogin.php"
$mail = base64_decode($str); 문제의 on line 22
$data=mysql_fetch_array(mysql_query("select * from $member_table where no='$member_no'"));
// Sendmail 폼
if(!$mailsend)
{
?>
<form method='post' enctype='multipart/form-data' action='<?=$PHP_SELF?>?mailsend=send'>
<table width="502" border="1" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="white" bordercolorlight="#CCCCCC">
<tr>
<td width="496" align="left" nowrap bgcolor="#EAEAEA" colspan="2">
<tt><span style="font-size:9pt;"><font face="굴림체"><b>받는사람</b></font></span></tt>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 이 름</font></span></tt>
</td>
<td align="left" width="450">
<font><input name=to_name size="48" value="<?=$data[name]?>" style="border-color:rgb(204,204,204); border-style:none;"></font>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 메 일</font></span></tt>
</td>
<td align="left" width="450">
<font><input name=to size="48" value="<?=$mail?>" style="border-color:rgb(204,204,204); border-style:none;"></font>
</td>
</tr>
<tr>
<td width="496" align="left" nowrap bgcolor="#EAEAEA" colspan="2">
<tt><span style="font-size:9pt;"><font face="굴림체"><b>보내는사람</b></font></span></tt>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 이 름</font></span></tt>
</td>
<td align="left" width="450">
<font><input name=from_name size="48" value='<?=$member[name]?>' style="border-color:rgb(204,204,204); border-style:none;"></font>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 메 일</font></span></tt>
</td>
<td align="left" width="450">
<font><input name=from size="48" value='<?=$member[email]?>' style="border-color:rgb(204,204,204); border-style:none;"></font>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<p style="line-height:100%; margin-top:0; margin-bottom:0;"><tt><span style="font-size:9pt;"><font face="굴림체"> 제 목</font></span></tt>
<td align="left" width="450">
<p style="line-height:100%; margin-top:0; margin-bottom:0;"><font><input name=subject size="48" style="border-color:rgb(204,204,204); border-style:none;"></font> </tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 내 용</font></span></tt>
</td>
<td align="left" width="450">
<textarea name=message rows="13" cols="65" style="border-color:rgb(204,204,204); border-style:none;"></textarea>
</td>
</tr>
<tr>
<td width="42" align="left" nowrap bgcolor="#EAEAEA">
<tt><span style="font-size:9pt;"><font face="굴림체"> 첨 부</font></span></tt>
</td>
<td align="left" width="450">
<input type=file size="50" name=userfile style="border-color:rgb(204,204,204); border-style:none;">
</td>
</tr>
<td colspan=2 align=center width="496" bgcolor="white">
<input type=submit name=submit value='메일전송'>
</td>
</table>
</form>
<?
}
// 메일 프로그램 시작
if($mailsend==send)
{
// 에러
if(!$to || !$subject)
{
echo("
<script>
window.alert('받는 사람의 메일주소나 제목은 반드시 입력해 주시기 바랍니다.')
history.go(-1)
</script>
");
}
else
{
// 받는 사람 처리
$to = $to_name." <".$to.">";
// 헤더부분
$mailheader .= "Return-Path: $from\r\n";
$mailheader .= "From: $from_name <$from>\r\n";
$mailheader .= "X-Mailer: Gfew Interface\r\n";
//첨부화일이 1개일경우
if($userfile && $userfile_size)
{
$filename=basename($userfile_name);
$fp = fopen($userfile,"r");
$file = fread($fp,$userfile_size);
fclose($fp);
if ($userfile_type == "")
{
$userfile_type = "application/octet-stream";
}
$boundary = "--------" . uniqid("part");
$mailheader .= "MIME-Version: 1.0\r\n";
$mailheader .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
$messages = "This is a multi-part message in MIME format.\r\n\r\n";
$messages .= "--$boundary\r\n";
$messages .= "Content-Type: text/html; charset=euc-kr\r\n";
$messages .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$messages .= nl2br(addslashes($message)) . "\r\n";
$messages .= "--$boundary\r\n";
$messages .= "Content-Type: $userfile_type; name=\"$filename\"\r\n";
$messages .= "Content-Transfer-Encoding: base64\r\n\r\n";
$messages .= ereg_replace("(.{80})","\\1\r\n",base64_encode($file));
$messages .= "\r\n--$boundary" . "\r\n";
}
//첨부화일이 없을경우
else
{
$mailheader .= "Content-Type: text/html; charset=euc-kr\r\n";
$mailheader .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$messages = $mail_head."\r\n";
$messages .= nl2br(addslashes($message))."\r\n";
$messages .= $mail_tail."\r\n";
}
mail($to,$subject,$messages,$mailheader);
echo("
<meta http-equiv='Refresh' content='0; URL=$PHP_SELF?mailsend=choice'>
");
}
}
// 메일 전송
if($mailsend==choice)
{
echo("
<table width=502 border=0>
<tr>
<td height=20> </td>
</tr>
<tr>
<td align=center>메일이 성공적으로 전송 되었습니다</td>
</tr>
<tr>
<td height=20> </td>
</tr>
<tr>
<td align=center>
<a href='$PHP_SELF'>돌아가기</a>
</td>
</tr>
</table>
");
}
?>
</body>
</html>
고거 함 집어넣어보삼;;
근데 이거 xe용인가요 아니면 제로보드4용인가요? xe에서 되면 저도 함 달아보려고요;; ㅎㅎ 이런거 찾고 있었습니다. ㅋㅋ