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 8769573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:22:32+00:00 2026-06-13T17:22:32+00:00

When I submit my form an email is sent to my email address with

  • 0

When I submit my form an email is sent to my email address with details entered in the form but when I recieve the email the data is blank here is my code

    <?php
$form = '<form action="test2.php" method="POST">
<table width="300" style="border: 1px solid black;">
<tr>
<td>Name         &nbsp; <td><input type="text" id="name">
<tr>
<td>Phone Number &nbsp; <td><input type="text" id="telephone">
<tr>
<td colspan="2">
<input type="submit" name="submit" value="submit"/></div>
</tr>
</table>';

echo $form;
$to = 'redacted@redacted.redacted';
$name = $_POST['name'];
$telephone = $_POST['telephone'];

$body = "<div>Name: $name <br>Telephone Number: $telephone<br></div>";


// subject
$subject = 'Call Back Requested';


// message
$message = $body;


// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


// Additional headers
$headers .= 'To:' . "\r\n";
$headers .= 'From: Call Back Request <contact-us-form@yellowgrid.co.uk>' . "\r\n";

if(isset($_POST['submit'])){

mail($to, $subject, $message, $headers);
}

?>

The problem is when I submit the form the I recieve an email that says

Name (Nothing)
Phone Number (Nothing)

Can anyone tell me where I am going wrong

Thanks In Advance

Adam

  • 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-13T17:22:33+00:00Added an answer on June 13, 2026 at 5:22 pm

    You have to specify the name attribute for your inputs:

    <input type="text" id="name" name="name">
    <input type="text" id="telephone" name="telephone">
    

    instead of

    <input type="text" id="name">
    <input type="text" id="telephone">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this code in my submit form <form id=myform action='hello.php' method='GET'> <input type=button
Here's my form: <form action=/scripts/addemail_fb.php method=post> <input type=text name=email value=Enter your email here! />
i have a PHP contact form that submits data, and an email...: <?php $dbh=mysql_connect
Is it possible to add the OR operator to php isset submit form code
I have an HTML5 form set up like so: <form id=contact-form action=php/email.php> <fieldset> <ul
I've cobbled together a jQuery function to validate email and submit the form using
I have a website with an existing form, that submits an email address to
I'm trying to POST and email address entry from a HTML form to a
iv added the header field in the form code but when i receive the
First question here so thanks in advance! The submit form I am attempting to

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.