Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:05:19+00:00 2026-06-10T06:05:19+00:00

Okay so I have a form that is using PHP to mail to an

  • 0

Okay so I have a form that is using PHP to mail to an e-mail address. I also have a jQuery/AJAX section that validates the form without reloading the page and executes the PHP. For some reason the Product Interest value from the interest drop down is not coming through in the e-mail. What am I missing? I’ve been driving myself mad with this. Thanks!

This is the form:

        <div class="contact-form">
            <div class="row">
                    <div class="field"><input type="text" id="first" name="first" class="input" placeholder="First Name"></div>
                    <div class="field"><input type="text" id="last" name="last" class="input" placeholder="Last Name"></div>
                    <div class="field"><input type="text" id="telephone" name="telephone" class="input" placeholder="Phone Number"></div>
            </div>
            <div class="row">
                    <div class="field"><input type="email" id="email" name="email" class="input" placeholder="E-mail"></div>
                    <div class="field">
                                        <select class="select" name="interest" id="interest">
                                            <optgroup label="Countwise Products:">
                                                  <option value="I-Count">I-Count</option>
                                                  <option value="Q-Count">Q-Count</option>
                                                  <option value="D-Count">D-Count</option>
                                                  <option value="Z-Count">Z-Count</option>
                                             </optgroup>
                                        </select> 
                    </div>
                    <input type="submit" value="Get Better Results!" class="button3 dark-blue submit"/>
                    <span class="error" style="display:none">All Fields Are Required!</span>
                    <span class="success" style="display:none">Contact Form Submitted Successfully</span>   
            </div>
        </div>


    </form>

This is the PHP for titled header_form_email.php

<?php

// POST Variables
//Name
$first = $_POST['first'];
$last = $_POST['last'];
//Phone
$telephone = $_POST['telephone'];
//E-mail 
$email = $_POST['email'];
//Interest
$interest= $_POST['interest'];

// Contact subject
$subject = "CountWise Website - Sales Request";

$name =  "$first" . " " . "$last";



$message = "You have received a new information request from Countwise.com\n".
"Name: " . "$name\n".
"Phone: " . "$telephone\n".
"Email: " . "$email\n".
"Product Interest: " . "$interest";

// From
$mailheader = "From: $email \r\n";

// Enter your email address
$to ="kelly@drastikdesigns.com";

$send_contact=mail($to,$subject,$message,$mailheader);

// Check, if message sent to your email
if($send_contact){
echo "<strong>We have received your information and will be in contact you shortly. Thank you.</strong>" ;
}
else {
echo "ERROR";
}
?>

This is the AJAX

$(function() {
    $(".submit").click(function() {
        var first = $("#first").val();
        var last = $("#last").val();
        var telephone = $("#telephone").val();
        var email = $("#email").val();
        var interest = $("#interest").val();
        var dataString = 'first=' + first + '&last=' + last + '&telephone=' + telephone + '&email=' + email + '&interest' + interest;

        if (first == '' || last == '' || telephone == '' || email == '') {
            $('.success').fadeOut(200).hide();
            $('.error').fadeOut(200).show();
        }
        else {
            $.ajax({
                type: "POST",
                url: "http://www.drastikdesigns.com/clients/countwise/php/header_form_email.php",
                data: dataString,
                success: function() {
                    $('.success').fadeIn(200).show();
                    $('.error').fadeOut(200).hide();
                }
            });
        }
        return false;
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:05:20+00:00Added an answer on June 10, 2026 at 6:05 am

    You forgot the equals:

    '&interest=' + interest;
    

    On a side note, why not just do:

    data:$("#formid").serialize(),
    

    That will save you tons of time and headache. Second point, using firebug/developers tools/chrome definitely helps when it comes to viewing the headers sent via ajax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I have this form that is set to preload a DB record
Okay all, I have a form that I want users to fill out. When
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay so I have a PHP script that makes a user an artist if
Okay so say I have a form element like this: HTML: <div class=form-item> <label>Current
Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay, so I've written a REST API implementation using mod_rewrite and PHP. I'm accepting
Okay so I have this page with quite a lot of javascript/jQuery in it.
I have done this many times in PHP using JS but being new to
I have this strange issue with my web app. You see, I'm using jQuery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.