폼메일 보내면 내용이 안나와요ㅜ
본문
<form name="contactform" method="post" action="send.php">
<div class="formmail">
<table class="form_table01">
<tr>
<th><span>*</span>상호</th>
<td><input name="company" type="text" required /></td>
<th><span>*</span>담당자</th>
<td><input name="name" type="text" required /></td>
</tr>
<tr>
<th><span>*</span>연락처</th>
<td><input name="tel" type="text" required /></td>
<th><span>*</span>E-mail</th>
<td><input name="email" type="text" required /></td>
</tr>
</table>
<table class="form_table02">
<tr>
<th>분야</th>
<th>장비명</th>
<th>임대기간</th>
<th>임대보증금</th>
<th>원하는 임대날짜</th>
</tr>
<tr>
<td><input name="pro1" type="text" /></td>
<td><input name="size1" type="text" /></td>
<td><input name="d1" type="text" /></td>
<td><input name="s1" type="text" /></td>
<td><input name="b1" type="text" /></td>
</tr>
<tr>
<td><input name="pro2" type="text" /></td>
<td><input name="size2" type="text" /></td>
<td><input name="d2" type="text" /></td>
<td><input name="s2" type="text" /></td>
<td><input name="b2" type="text" /></td>
</tr>
<tr>
<td><input name="pro3" type="text" /></td>
<td><input name="size3" type="text" /></td>
<td><input name="d3" type="text" /></td>
<td><input name="s3" type="text" /></td>
<td><input name="b3" type="text" /></td>
</tr>
<tr>
<td><input name="pro4" type="text" /></td>
<td><input name="size4" type="text" /></td>
<td><input name="d4" type="text" /></td>
<td><input name="s4" type="text" /></td>
<td><input name="b4" type="text" /></td>
</tr>
<tr>
<td><input name="pro5" type="text" /></td>
<td><input name="size5" type="text" /></td>
<td><input name="d5" type="text" /></td>
<td><input name="s5" type="text" /></td>
<td><input name="b5" type="text" /></td>
</tr>
<tr>
<td><input name="pro6" type="text" /></td>
<td><input name="size6" type="text" /></td>
<td><input name="d6" type="text" /></td>
<td><input name="s6" type="text" /></td>
<td><input name="b6" type="text" /></td>
</tr>
<tr>
<td><input name="pro7" type="text" /></td>
<td><input name="size7" type="text" /></td>
<td><input name="d7" type="text" /></td>
<td><input name="s7" type="text" /></td>
<td><input name="b7" type="text" /></td>
</tr>
<tr>
<td><input name="pro8" type="text" /></td>
<td><input name="size8" type="text" /></td>
<td><input name="d8" type="text" /></td>
<td><input name="s8" type="text" /></td>
<td><input name="b8" type="text" /></td>
</tr>
<tr>
<td><input name="pro9" type="text" /></td>
<td><input name="size9" type="text" /></td>
<td><input name="d9" type="text" /></td>
<td><input name="s9" type="text" /></td>
<td><input name="b9" type="text" /></td>
</tr>
<tr>
<td><input name="pro10" type="text" /></td>
<td><input name="size10" type="text" /></td>
<td><input name="d10" type="text" /></td>
<td><input name="s10" type="text" /></td>
<td><input name="b10" type="text" /></td>
</tr>
</table>
<table class="form_table03">
<tr>
<th>기타상세내역</th>
<td><textarea name="memo" type="text" cols="80" rows="5" /></textarea></td>
</tr>
</table>
</div>
<div class="formmail_btn">
<span><input type="submit" value="전송하기" class="btn btn-red"></span>
<span><input name="재설정" type="reset" value="다시작성" class="btn btn-black"></span>
</div>
</form>
-----------send 파일
<?
$mname="aaa"; // 받을 사람 이름
$memail="*** 개인정보보호를 위한 이메일주소 노출방지 ***"; // 받을 사람 이메일(자기메일로 수정)
$admin_name ="bbb"; //보낸 사람 이름
$admin_email="*** 개인정보보호를 위한 이메일주소 노출방지 ***"; // 보낸 사람 이메일(자기메일로 수정)
//$subject = "견적 사항 입니다.; // 제목
$subject = "=?EUC-KR?B?".base64_encode(iconv("UTF-8","EUC-KR","견적 문의 입니다."))."?=\r\n";
$additional_headers = "From: $admin_name <$admin_email>\n";
$additional_headers.= "Reply-To : $admin_email \n";
$additional_headers.= "Content-Type: text/html;charset=utf-8\n";
$contents = ("
<HTML>
<head>
<title>견적사항</title>
</head>
<BODY bgColor='#FAFAEE\'>
<p>온라인 견적문의 입니다.</p><br>
<table width=800 border=0 cellspacing=0 cellpadding=0>
<tr>
<td><table width=800 border=0 cellspacing=1 cellpadding=3 bgcolor=#dddddd>
<tr>
<td width=110 height=32 bordercolordark=#f2f2f2 bgcolor=#f2f2f2><font color=#666666><strong> * 상 호</strong></font></td>
<td width=180 height=32 bgcolor=#fff> $company</td>
<td width=110 height=32 bordercolordark=#f2f2f2 bgcolor=#f2f2f2><font color=#666666><strong> * 담당자</strong></font></td>
<td width=180 height=32 bgcolor=#fff> $name</td>
</tr>
<tr>
<td width=110 height=32 bordercolordark=#f2f2f2 bgcolor=#f2f2f2><font color=#666666><strong> * 연락처</strong></font></td>
<td width=180 height=32 bgcolor=#fff> $tel</td>
<td width=110 height=32 bordercolordark=#f2f2f2 bgcolor=#f2f2f2><font color=#666666><strong> * E-mail</strong></font></td>
<td height=32 bgcolor=#fff> $email</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width=800 border=0 cellspacing=1 cellpadding=3 bgcolor=#dddddd>
<tr>
<td width=20% height=32 align=center bordercolordark=#f2f2f2 bgcolor=#f2f2f2><strong><font color=#666666>분 야</font></strong></td>
<td width=20% align=center bordercolordark=#f2f2f2 bgcolor=#f2f2f2><strong><font color=#666666>장비명 </font></strong></td>
<td width=20% align=center bordercolordark=#f2f2f2 bgcolor=#f2f2f2><strong><font color=#666666>임대기간 </font></strong></td>
<td width=20% align=center bordercolordark=#f2f2f2 bgcolor=#f2f2f2><strong><font color=#666666>임대보증금</font></strong></td>
<td width=20% align=center bordercolordark=#f2f2f2 bgcolor=#f2f2f2><strong><font color=#666666>원하는 임대일자</font></strong></td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro1</td>
<td bgcolor=#fff align=center>$size1</td>
<td bgcolor=#fff align=center>$d1</td>
<td bgcolor=#fff align=center>$s1</td>
<td bgcolor=#fff align=center>$b1</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro2</td>
<td bgcolor=#fff align=center>$size2</td>
<td bgcolor=#fff align=center>$d2</td>
<td bgcolor=#fff align=center>$s2</td>
<td bgcolor=#fff align=center>$b2</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro3</td>
<td bgcolor=#fff align=center>$size3</td>
<td bgcolor=#fff align=center>$d3</td>
<td bgcolor=#fff align=center>$s3</td>
<td bgcolor=#fff align=center>$b3</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro4</td>
<td bgcolor=#fff align=center>$size4</td>
<td bgcolor=#fff align=center>$d4</td>
<td bgcolor=#fff align=center>$s4</td>
<td bgcolor=#fff align=center>$b4</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro5</td>
<td bgcolor=#fff align=center>$size5</td>
<td bgcolor=#fff align=center>$d5</td>
<td bgcolor=#fff align=center>$s5</td>
<td bgcolor=#fff align=center>$b5</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro6</td>
<td bgcolor=#fff align=center>$size6</td>
<td bgcolor=#fff align=center>$d6</td>
<td bgcolor=#fff align=center>$s6</td>
<td bgcolor=#fff align=center>$b6</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro7</td>
<td bgcolor=#fff align=center>$size7</td>
<td bgcolor=#fff align=center>$d7</td>
<td bgcolor=#fff align=center>$s7</td>
<td bgcolor=#fff align=center>$b7</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro8</td>
<td bgcolor=#fff align=center>$size8</td>
<td bgcolor=#fff align=center>$d8</td>
<td bgcolor=#fff align=center>$s8</td>
<td bgcolor=#fff align=center>$b8</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro9</td>
<td bgcolor=#fff align=center>$size9</td>
<td bgcolor=#fff align=center>$d9</td>
<td bgcolor=#fff align=center>$s9</td>
<td bgcolor=#fff align=center>$b9</td>
</tr>
<tr>
<td height=32 bgcolor=#fff align=center>$pro10</td>
<td bgcolor=#fff align=center>$size10</td>
<td bgcolor=#fff align=center>$d10</td>
<td bgcolor=#fff align=center>$s10</td>
<td bgcolor=#fff align=center>$b10</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width=800 border=0 cellspacing=1 cellpadding=3 bgcolor=#dddddd>
<tr>
<td width=26% height=32 bordercolordark=#f2f2f2 bgcolor=#f2f2f2><font color=#666666><strong> 기타상세내역</strong></font></td>
<td bgcolor=#fff height=100> $memo</td>
</tr>
</table></td>
</tr>
</table>
</BODY>
</HTML>
");
mail($memail, $subject, $contents, $additional_headers);
echo "<script>alert('send mail');location.href='formmail.php'</script>";
?>
폼메일 전송하면 테이블이 정상적으로 나오긴하는데 값 불러오는 부분? 이라고 하나요?
작성했던 부분만 빈공란으로 나오네요ㅜ 사진 첨부합니다.
내용 다 작성해서 메일전송한건데 공란으로 나와요.
어디부분을 수정해야할까요?
답변 2
안녕하세요, 해당 내용의 값은 모두 변수처리되어있네요.
폼메일을 작성하는 페이지에 변수의 값을 지정해주면 정상적으로 불러올거에요.
Form 에서 데이터값을 넘겨서 처리하는거라면 $_REQUEST 값을 통해 넘어오는 값을 확인할 수 있으며
저장된 값을 처리하는거라면 DB에 저장된 데이터값을 호출하면됩니다.
Form 데이터값을 넘기거나 DB호출등의 기본처리를 못하시면 이부분에 대해 공부가 필요할 듯 합니다.
아예 기본부터 설명하기엔 간략하게 설명드리기 어렵네요ㅠ