Contact form sends mail with empty message field

后端 未结 2 965
孤独总比滥情好
孤独总比滥情好 2021-01-29 04:54

When i send an email with my contact form the textarea value does not send and the \"message:\" field is always empty in the email.

Declaring the input variables manuall

相关标签:
2条回答
  • 2021-01-29 05:44

    I found the issue on your code:

    the Values from textarea never made it the Server side, because you are doing this in your PHP:

    $message = $_POST['text'];
    

    You should do this in order to get the value from textarea:

    $message = $_POST['message'];
    

    This will solve your issue :). Hope it helps.

    0 讨论(0)
  • 2021-01-29 05:48

    Your variable naming is inconsistent.

    In your HTML-form you're using message for the name-attribute. But in you're AJAX-call and in the PHP $_POST-GLOBAL you are looking for a variable called text.

    0 讨论(0)
提交回复
热议问题