选择菜单问题

时间:2019-05-07 16:04:42

标签: javascript html menu

我想在HTML页面上做一个选择菜单。如果用户输入姓名电话号码和电子邮件,则“客户”需要选择一个选项。

完成了,现在的问题是,当我收到电子邮件的某些原因时,它只向我显示:选择

我需要选择的菜单才能显示。

我有一个邮件配置PHP,但我真的不知道出了什么问题

<div>
  <select class="form-control" id="select" type="sel" placeholder="Válassz*" required="required" data-validation-required-message="Kérlek válassz." name="dropdown">
    <option value="Laptop">Laptop</option>
    <option value="Szamitogep">Számítógép</option>
    <option value="iPhone">iPhone</option>
    <option value="Samsung">Samsung</option>
    <option value="Egyeb">Egyéb</option>
  </select>
</div>

<?php
    // Check for empty fields
    if(empty($_POST['name'])      ||
       empty($_POST['email'])     ||
       empty($_POST['phone'])     ||
       empty($_POST['message'])   ||
    
       !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
       {
           echo "No arguments Provided!";
           return false;
       }
       
    $name = strip_tags(htmlspecialchars($_POST['name']));
    
    $email_address = strip_tags(htmlspecialchars($_POST['email']));
    
    $phone = strip_tags(htmlspecialchars($_POST['phone']));
    
    $message = strip_tags(htmlspecialchars($_POST['message']));
    
    $dropdown = strip_tags(htmlspecialchars($POST['dropdown']));
    
       
    // Create the email and send the message
    $to = 'myemailadress@mail.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
    $email_subject = "my subject :  $name";
    $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message\n\nSelect: $value";
    $headers = "noreply@mywebsite.com"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
    $headers .= "Reply-To: $email_address";   
    mail($to,$email_subject,$email_body,$headers);
    return true;         
    ?>

感谢您的帮助!

0 个答案:

没有答案