테스트 사이트 - 개발 중인 베타 버전입니다

메일폼에 이메일 메세지는 4가지 이상 못하나요?

janen 6년 전 조회 2,482

</strong></p>

<p> // validation expected data exists

    if(!isset($_POST['first_name']) ||

        !isset($_POST['email']) ||

        !isset($_POST['telephone']) ||

 </p>

<p>        !isset($_POST['comments'])){

        died('We are sorry, but there appears to be a problem with the form you submitted.');      

    }

    

    $first_name = $_POST['first_name']; // required

    $email_from = $_POST['email']; // required

    $telephone = $_POST['telephone']; // not required

 </p>

<p>

    $comments = $_POST['comments']; // required</p>

<p>    $error_message = "";

    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/';

  if(!preg_match($email_exp,$email_from)) {

    $error_message .= 'The Email Address you entered does not appear to be valid.
';

  }

   

  if(strlen($comments) < 2) {

    $error_message .= 'The Comments you entered do not appear to be valid.
';

  }

  if(strlen($error_message) > 0) {

    died($error_message);

  }

    $email_message = "";

    

    function clean_string($string) {

      $bad = array("content-type","bcc:","to:","cc:","href");

      return str_replace($bad,"",$string);

    }

    

    $email_message .= "이름 : ".clean_string($first_name)."\n\n";

    $email_message .= "이메일 : ".clean_string($email_from)."\n\n";

    $email_message .= "연락처 : ".clean_string($telephone)."\n\n";

 

    $email_message .= "주소 및 수거날짜 : ".clean_string($comments)."\n\n";

    

    </p>

<p><strong>

 

저위에다가

 

 $adr = $_POST['adr']; // not required
 $ymd = $_POST['ymd']; // not required

 

이거 둘을 추가해서 3군데에 넣어줬더니 메일을 발송할수 없다고 나오네요..

원래 메일폼은 이이상 추가해서 넣어도 안되는걸까요?ㅠㅠ

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

티로그
6년 전

</p>

<p>$email_message .= "주소 : ".clean_string($adr)."\n\n";</p>

<p>$email_message .= "날짜 : ".clean_string($ymd)."\n\n";</p>

<p>$email_message .= "이름 : ".clean_string($first_name)."\n\n";

$email_message .= "이메일 : ".clean_string($email_from)."\n\n";

$email_message .= "연락처 : ".clean_string($telephone)."\n\n";

$email_message .= "주소 및 수거날짜 : ".clean_string($comments)."\n\n";</p>

<p>

이런식으로 해주신거 같은데요. 에러의심되는 라인에 exit;넣어 확인하셔야 될거 같습니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

k123
6년 전

추가 가능합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

플라이
6년 전

메일폼에 항목 추가해서 넣어도 되는건데 두개를 추가해서 넣었는데

 

어떻게 오류가 나시는지 확인이 필요합니다.

 

말씀하신 내용 데이터를 받아서 처리하는 과정에서 문제가 있는듯 합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인