doudanma9706 2018-01-23 19:35 采纳率: 100%
浏览 42
已采纳

通过PHP发送下拉表单信息

A form was created with a dropdown , the results of the form are sent to a separate email. All of the items in the form are appearing except for the dropdown. Why is the dropdown result not appearing in the email?

<?php
if(!isset($_POST['submit']))
{
    //This page should not be accessed directly. Need to submit the form.
    echo "error; you need to submit the form!";
}
$name = $_POST['cd_FULLNAME'];
$visitor_email = $_POST['Email'];
$dropdown = $_POST['dropdown'];
$message = $_POST['cd_CONTACTPHONENUM'];


$email_from = 'jla3633i@gmail.com';//<== update the email addresss
$email_subject = "RRSP Campaign Phone Call Request";
$email_body = "The following information was submitted via . The prospective customer has been informed that they will be contacted by a representative within 1 business day regarding our current promotional offer. 
 Their name is: $name.
".
    "Their phone number is: $message . They prefer to be contacted at $dropdown. Their email address is: $visitor_email. This email was sent to your email address at: ". 
    
        <div class="contact-form">
                <!-- Form -->
                    <form name="lowerForm" id="lowerForm" action="form-to-email.php" method="post" onsubmit="return validate_lowerForm(this)" autocomplete="on">
                <!-- ReturnURL - when the user hits submit, they'll get sent here -->
                <input type="hidden" name="ReturnURL" value="/save/thankyou.html">
                    <!-- Left Inputs -->
                    <div class="col-xs-12 animated" data-animation="fadeInLeft" data-animation-delay="300">
                        <!-- Name -->
                        <input type="text" name="cd_FULLNAME" id="lowerName" required="required" class="form light" placeholder="Name" />
                        <!-- Email -->
                        <input type="email" name="Email" id="lowerEmail" required="required" class="form light" placeholder="Email" />
                        <!-- Subject -->
                        <input type="text" name="cd_CONTACTPHONENUM" id="lowerPhone" required="required" class="form light" placeholder="Phone Number" />
                        <!-- Send Button -->
                        <select id="dropdown" form="dropdown" name="dropdown" class="form light" />
                         <option value="" disabled selected>Preferred Contact Method</option>
    <option value="phone">Phone</option>
    <option value="email">Email</option>
  </select>
  

                                                <!-- Checkbox --><p class="service-header light white">
                

<br>
                        <button type="submit" id="lowerSubmit" name="Submit" class="form-btn light" value="Subscribe">Submit</button> 

</div>
  • 写回答

1条回答 默认 最新

  • drbii0359 2018-01-23 19:41
    关注

    Your dropdown doesn't show because you used the "form" attribute on it, pointing to a "dropdown" form that doesn't exist. Remove that and it should be fine.

    <select id="dropdown" name="dropdown" class="form light" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号