Css3切换开关没有发布在电子邮件联系表格PHP上

时间:2015-09-22 12:02:50

标签: php html forms

此开关是表单的一部分,我无法通过PHP将此元素发布到电子邮件中,似乎没有使用data-on =&#34来检查已检查;是&# 34;数据断="否"开关的属性。

HTML

<form class="booking-form" name="bookchalet" action="booking_form.php"  method="post"> 
    <div id="switchbox">
        <div class="switch">
            <input id="cmn-toggle-1" class="cmn-toggle cmn-toggle-round" type="checkbox"/>
            <label for="cmn-toggle-1"></label>
        </div>
        <div class="switch">
            <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"/>
            <label for="cmn-toggle-4"></label>
        </div>
        <div class="switch">
            <input id="cmn-toggle-7" class="cmn-toggle cmn-toggle-yes-no" name="apartment" type="checkbox"/>
            <label for="cmn-toggle-7"  data-on="Yes" data-off="No" ></label>
        </div>
    </div>
    </li>   
</form> 

PHP

<?php
    if ($_POST["submit"]){
        $apartment = $_POST['apartment'];
        $submit = $_POST['submit'];
        $to = 'myemail@email.com';
        $headers = 'From: website' . "\r\n";
        $subject =  'FORM: '.$submit. "\r\n";
        $message =  ' Booking Details: '.$submit.', With apartment?:'.$apartment.."\r\n";

        mail($to, $subject, $message, $headers); //This method sends the mail.
        echo "Your email was sent!"; // success message
        $url = 'index.html';
        echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';  
    }
    }
?>

我已经取出了表单中的其他元素,因为它很长,而且它们正确地发布到电子邮件中。

1 个答案:

答案 0 :(得分:1)

在.php代码中,我没有看到与数据库和/或插入语句的任何连接。 。 。代码看起来像这样:

<configuration>
    <!-- By default the test results are saved in a file /target/jmeter/results/<testname>-<timestamp>.jtl 
        Further processing is easier without timestamp though. -->
    <testResultsTimestamp>false</testResultsTimestamp>

    <!-- To simplify debugging, it is advisable to adapt the loglevel. The 
        jmeter logs are written to the file jmeter.log. -->
    <overrideRootLogLevel>DEBUG</overrideRootLogLevel>

    <!-- By default, the console output during a jmeter test run is suppressed. 
        We want to display the progress using the listener "Generate Summary Results" 
        (which periodically prints stats to stdout). Therefore we have to make sure, 
        that the jmeter output is not suppressed. -->
    <suppressJMeterOutput>false</suppressJMeterOutput>

    <!-- If tests fail (e.g. a http-request running into a timeout), the corresponding 
        maven goal also fails (and subsequent goals aren't executed anymore). We 
        want to create graphs from test-results, no matter if some requests failed 
        or not, so we ignore jmeter failures. -->
    <ignoreResultFailures>true</ignoreResultFailures>
</configuration>