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

  • Home
  • SEARCH
  • 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 6237629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:03:56+00:00 2026-05-24T11:03:56+00:00

The problem I have is that the form I have created I am sure

  • 0

The problem I have is that the form I have created I am sure I am missing something simple for some reason it does not send the phone number to the email all of the other fields get sent and are outputted in the emai.

The HTML form is below:

            <div class="form-wrapper">
                <p id="success"></p>
                    <form id="contact-form" name="contact-form" method="POST">
                    <label class="label">Name:</label>
                    <p><input type="text" value="" name="contact-names" class="contact-names"/><span class="name-required"></span></p>
                    <label class="label">Email:</label>
                     <p><input type="text" value="" name="contact-email" class="contact-email"/><span class="email-required"></span></p>
                     <label class="label">Phone:</label>
                     <p><input type="text" value="" name="contact-phone" class="contact-phone"/><span class="phone-required"></span></p>
                     <label class="label">Message</label>
                     <p>
                    <textarea class="contact-commnent" name="comments">
                    </textarea><span class="comment-required"></span></p>
                    <label class="label"></label>
                     <p id="p-submit">
                    <input id="submit-form" class="submit-button" name="submit"type="submit" value="Submit"></p>
                 </form>
                </div>

the javascript is:

$('#submit-form').click(function(){

     var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var names               = $('#contact-form [name="contact-names"]').val();  
   var email_address = $('#contact-form [name="contact-email"]').val();
   var phone = $('#contact-form [name="contact-phone"]').val();
   var comment           = $.trim($('#contact-form .contact-commnent').val());
   var data_html ='' ;


                if(names == ""){
                     $('.name-required').html('Your name is required.');
                }else{
                     $('.name-required').html('');
                }
                if(email_address == ""){
                     $('.email-required').html('Your email is required.');
                }else if(reg.test(email_address) == false){
                     $('.email-required').html('Invalid Email Address.');
                }else{
                     $('.email-required').html('');
                }

                if(phone == ""){
                     $('.phone-required').html('Your Phone Number is required.');
                }else{
                     $('.phone-required').html('');
                }

                if(comment == ""){
                     $('.comment-required').html('Comment is required.');
                }else{
                     $('.comment-required').html('');
                }

        if(comment != "" && names != "" && reg.test(email_address) != false){

            data_html = "names="+ names + "&comment=" + comment + "&email_address="+ email_address;

            //alert(data_html);

          $.ajax({
                  type: 'POST',
                  url: 'contact-send.php',
                  data: data_html,
                  success: function(msg){
                    if (msg == 'sent'){
                            $('#success').html('Your Message Has Been Sent We Will Be In Touch Soon')   ;
                            $('#contact-form [name="contact-names"]').val('');   
                          $('#contact-form [name="contact-email"]').val('');
                          $('#contact-form [name="contact-phone"]').val('');
                        $('#contact-form .contact-commnent').val('');

                        }else{
                            $('#success').html('Mail Error. Please Try Again.!')    ;   
                        }
                  }
            });

      }

        return false;
    });

The PHP is:

<?php
 $names = $_POST['names'];
 $email = $_POST['email_address'];
 $phone = $_POST['phone'];
 $comment = $_POST['comment'];
 $to ='EMAIL ADDRESS GOES HERE REMOVED';

 $message = "";
 $message .= "Name: " . htmlspecialchars($names, ENT_QUOTES) . "<br>\n";
 $message .= "Email: " . htmlspecialchars($email, ENT_QUOTES) . "<br>\n";
 $message .= "Phone: " . htmlspecialchars($phone, ENT_QUOTES) . "<br>\n";
 $message .= "Message: " . htmlspecialchars($comment, ENT_QUOTES) . "<br>\n";
 $lowmsg = strtolower($message);

 $headers = "MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\n";
 $headers .= "From: \"" . $names . "\" <" . $email . ">\r\n";
 $headers .= "Reply-To: " .  $email . "\r\n";
 $message = utf8_decode($message);  mail($to, "Note from the Contact Form", $message, $headers);

 if ($message){
        echo 'sent';
 }else{
      echo 'failed';
 }
?>

If someone can see something I have missed I would be very grateful I have been looking at this for ages and can’t see what I am missing.

  • 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-05-24T11:03:57+00:00Added an answer on May 24, 2026 at 11:03 am
    data_html = "names="+ names + "&comment=" + comment + "&email_address="+ email_address;
    

    This line is the data you’re posting to the server, but it looks like you’re forgetting to attach the phone number!

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

Sidebar

Related Questions

i have bought a template that have built in contact form problem is that
I have a problem. The client is claiming that a prize signup form I
The problem I am encountering is that for my login form I have to
I have an InfoPath form with several fields on, the problem is that one
Not sure if I am missing something very blatant or (much more doubtful) I
i have created little search method. The problem that its hard to read it
I'm having a strange problem and not sure how to troubleshoot it. I have
I have a form that is used like a dialog, to be sure that
The problem: we have jobs that run from a few seconds to a few
In a couple of scripts that I use I have problem that is intermittent.

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.