Form HTML > PHP > SQL > Email
<p>Here's the HTML Code I have for the form fields.</p>

<p>It needs to be read by the PHP so that a SQL table <code>idE</code> reads it and bounces that infomation to an email account.  Server connection (connect.php works fine).</p>

<p>I am getting a white blank screen upon submitting the forms with no results.</p>

<p>HTML</p>

<pre><code>&lt;div class="pure-u-ss-1 pure-u-lg-1-2"&gt;
    &lt;div class="grey form"&gt;
        &lt;form id="dealerform" method="POST" action="../dealerform.php"&gt;
            &lt;input id="dfr1" type="hidden" name="retailer" value="0" /&gt;
            &lt;input id="dfex1" type="hidden" name="experience" value="0" /&gt;
            &lt;input id="dfl1" type="hidden" name="locations" value="0" /&gt;
            &lt;input id="dfa1" type="hidden" name="assets" value="0" /&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;First Name*&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input id="dffname" name="firstName" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Last Name*&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input id="dflname" name="lastName" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;E-mail Address*&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input id="dfemail" name="email" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Phone Number&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="phoneNumber" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Address&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="address" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;City&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="city" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;State&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="state" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Zip&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="zip" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Company Name&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="companyName" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Available Liquid Assets&lt;/label&gt;
                    &lt;div class="fleft assets select box" data-id="dfa1" data-form="dealerform" data-value="1" onclick="selectCheckboxSet(jQuery(this))"&gt;Yes&lt;/div&gt;
                    &lt;div class="fright assets select box" data-id="dfa1" data-form="dealerform" data-value="0" onclick="selectCheckboxSet(jQuery(this))"&gt;No&lt;/div&gt;
                    &lt;div style="clear:both;"&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Existing Wireless Retailer?&lt;/label&gt;
                    &lt;div class="fleft retailer select box" data-id="dfr1" data-form="dealerform" data-value="1" onclick="selectCheckboxSet(jQuery(this))"&gt;Yes&lt;/div&gt;
                    &lt;div class="fright retailer select box" data-id="dfr1" data-form="dealerform" data-value="0" onclick="selectCheckboxSet(jQuery(this))"&gt;No&lt;/div&gt;
                    &lt;div style="clear:both;"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Years of retail experience&lt;/label&gt;
                    &lt;div class="fleft experience select box" data-id="dfex1" data-form="dealerform" data-value="1" onclick="selectCheckboxSet(jQuery(this))"&gt;0-2&lt;/div&gt;
                    &lt;div class="fcenter experience select box" data-id="dfex1" data-form="dealerform" data-value="2" onclick="selectCheckboxSet(jQuery(this))"&gt;2-5&lt;/div&gt;
                    &lt;div class="fright experience select box" data-id="dfex1" data-form="dealerform" data-value="3" onclick="selectCheckboxSet(jQuery(this))"&gt;5+&lt;/div&gt;
                    &lt;div style="clear:both;"&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Types of products you offer:&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="typeProducts" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Carrier services you offer:&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="carrierServices" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="two column row"&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;Number of retail locations:&lt;/label&gt;
                    &lt;div class="fleft locations select box" data-id="dfl1" data-form="dealerform" data-value="1" onclick="selectCheckboxSet(jQuery(this))"&gt;0-2&lt;/div&gt;
                    &lt;div class="fcenter locations select box" data-id="dfl1" data-form="dealerform" data-value="2" onclick="selectCheckboxSet(jQuery(this))"&gt;2-5&lt;/div&gt;
                    &lt;div class="fright locations select box" data-id="dfl1" data-form="dealerform" data-value="3" onclick="selectCheckboxSet(jQuery(this))"&gt;5+&lt;/div&gt;
                    &lt;div style="clear:both;"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="input item"&gt;
                    &lt;label&gt;How did you hear about us?&lt;/label&gt;
                    &lt;div class="field box"&gt;&lt;input name="howHearAbout" type="" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="centered row"&gt;
                &lt;div class="input item"&gt;
                    &lt;div class="submit button" onclick="validateSubmitDealer()"&gt;&lt;img class="btn ready" src="img/form_submit_button.png" /&gt;&lt;img class="btn over" src="img/form_submit_button_over.png" /&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>PHP </p>

<pre><code>    &lt;?php
    mail($recipient, $subject, $headers, $howHearAbout);

if($_POST["submit"]) {
    $recipient='haseeb.shaida@stjacques.com';
    $subject="Become a dealer inquiry";
    $headers = 'From: PrepaidPrograms@SimplyPrepaidDealer.com';
    $dffname=$_POST['firstName'];
    $dflname=$_POST['lastName'];
    $dfemail=$_POST['email'];
    $phoneNumber=$_POST['phoneNumber'];
    $address=$_POST['address'];
    $city=$_POST['city'];
    $state=$_POST['state'];
    $zip=$_POST['zip'];
    $companyName=$_POST['companyName'];
    $dfa1=$_POST['assets'];
    $dfr1=$_POST['retailer'];
    $dfex1=$_POST['experience'];
    $typeProducts=$_POST['typeProducts'];
    $carrierServices=$_POST['carrierServices'];
    $dfl1=$_POST['locations'];
    $howHearAbout=$_POST['howHearAbout'];


}

?&gt;

&lt;?= isset($thankYou) ? $thankYou : 'Did not send' ?&gt;

&lt;?php

if(valid) {
    jQuery('#dealerform').append(
        jQuery('&lt;input /&gt;')
         .attr('type', 'hidden')
         .attr('name', 'submit')
         .attr('value', 'true')
    ).submit();
}

?&gt;

&lt;?= isset($thankYou) ? $thankYou : 'Did not send' ?&gt;

&lt;?php include("connect.php"); 

?&gt;
</code></pre>

<p>ValidateSubmit() JS</p>

<pre><code>function validateSubmitDealer() {
    var valid = true;
    // check form values here
    var fname = jQuery("#dealerform #df-fname").val();
    if( fname === '' ) {
        valid = false;
        jQuery("#dealerform #df-fname").parent().addClass('error');
    }
    var lname = jQuery("#dealerform #df-lname").val();
    if( lname === '' ) {
        valid = false;
        jQuery("#dealerform #df-lname").parent().addClass('error');
    }
    var email = jQuery("#dealerform #df-email").val();
    if( email === '' ) {
        valid = false;
        jQuery("#dealerform #df-email").parent().addClass('error');
    }
    if( valid ) {
        jQuery('#dealerform').submit();
    }
</code></pre>