폼메일에서 textarea nl2br 부분에 자꾸 Array라는 문자열이 딸려오는 현상

폼메일에서 textarea nl2br 부분에 자꾸 Array라는 문자열이 딸려오는 현상

QA

폼메일에서 textarea nl2br 부분에 자꾸 Array라는 문자열이 딸려오는 현상

답변 1

본문

안녕하세요. 초보 퍼블리셔 입니다.

sir에서 얻은 폼메일을 활용하여 만드는 중입니다.

아래와 같은 형태로 폼메일을 날립니다.

임시로 값을 1,2,3,4,5,6,7 을 넣어서 작성해보았습니다. 숫자가 문제인가 싶어 문자열도 넣어보고 넣어봤으나 동일하게 아래와 같은 결과값이 나옵니다.

 

프로젝트명 :1111111

프로젝트 설명 : Array2222222222

프로젝트 예산 : 333333

성명 : 44444444

이메일주소 : *** 개인정보보호를 위한 이메일주소 노출방지 ***

영상 최종 확인일 :66666

전화번호 : 777777

 

라고 Content부분에서 Array라는 글씨가 딸려옵니다.

어느부분이 문제인지 정확하게 알지 못해 이것저것 수정해보았습니다만, Array라는 문자열이 자꾸 딸려옵니다.

이에 선배님들께 조언 구합니다.

감사합니다.


<form method="post" action="./form_mail.php">
    <fieldset>
        <input type="text" name="subject" id="subject" required autocomplete="off">
        <textarea name="content" id="content" rows="10"></textarea>
        <input type="text" name="budget" id="budget" required autocomplete="off">
        <input type="text" name="name1" id="name1" required autocomplete="off">
        <input type="email" name="email" id="email" autocomplete="off">
        <input type="text" name="lastConfirm" id="lastConfirm" autocomplete="off">
        <input type="text" name="numb" id="numb" autocomplete="off">
    </fieldset>
</form>

<?php
    $mailTo     =   "Dummy1";
    // 받는사람 메일 주소;
    $mailFrom   =   "Dummy2";
    // 보내는사람 메일주소
    $mailSubject = $_POST['subject'];
    $mailContent = '프로젝트명 :'.$_POST['subject'].'<br><br>'
    .'프로젝트 예산 : '.$_POST['budget'].'<br><br>'
    .'성명 : '.$_POST['name1'].'<br><br>'
    .'이메일주소 : '.$_POST['email'].'<br><br>'
    .'영상 최종 확인일 :'.$_POST['lastConfirm'].'<br><br>'
    .'전화번호 : '.$_POST['numb'].'<br><br>'
    .'프로젝트 설명 : '.$_POST.nl2br($_POST['content']);
 
    $mailHeader = "From: $mailFrom\r\n";
    $mailHeader .= "MIME-Version: 1.0\r\n";
    $mailHeader .= "Content-type: text/html; charset=euc-kr\r\n";
 
    $mailResult = mail ($mailTo, $mailSubject,    
    $mailContent, $mailHeader,'-f'.$mailFrom);
 
    if (true == $mailResult) {
        echo "Success 메일이 발송되었읍니다.";
    }
    else {
        echo "Failuare 메일이 발송되지 않았읍니다.";
    }
?>

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로