submitted my php form, but none of the values were sent

前端 未结 1 1353
天命终不由人
天命终不由人 2021-01-28 15:16

For some reason, the options are not showing up in my email. I can get the email to send just fine. I can see the body and all its comments, but none of the entries that the use

1条回答
  •  花落未央
    2021-01-28 16:14

    Change method="get"

    to

    method="post"

    and remove enctype . It's not required in this case.

    Also, why is there a ? in your action? You can keep action blank as it is posting to the same page.

    To make things even simpler for you, copy paste the below code and run the file again

    if(isset($_POST['submit']))
    {
    $ToEmail = 'dmandrade1978@gmail.com'; 
    $EmailSubject = 'Message from web page!!'; 
    
    $name = $_POST['name'];
    $email = $_POST['email'];
    $comment = $_POST['comment'];
    $urphone = $_POST['urphone'];
    $event = $_POST['event'];
    $date = $_POST['date'];
    $mail = $_POST['mail'];
    $phone = $_POST['phone'];
    $comment = $_POST['comment'];
    $hearaboutus = $_POST['hearaboutus'];
    
    $body = <<
    Name: $name 
    Comment: $comment
    Phone: $urphone
    Date: $urdate
    Comment: $comment
    How did you hear?: $hearaboutus
    Mail optiom: $mail
    EMAIL; $header = "Content-type: text/html\r\n"; mail("$ToEmail", "$EmailSubject", "$body", "$header"); echo ("Message Sent!"); } ?>

    Name:

    E-mail:

    Phone #:

    Event type:

    Date of event:

    Prefered method of contact:
    Phone
    E-mail

    How did you hear about us?:

    Message, questions, or availability:

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