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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:09:22+00:00 2026-06-04T12:09:22+00:00

Like my title says, my email form is submitting undefined within the email. Let

  • 0

Like my title says, my email form is submitting “undefined” within the email. Let me start off with some code…

HTML:

<form action="contactform.php" method="post" enctype="multipart/form-data" name="contact">
        <input name="name" type="text" value="Name" onfocus="if(this.value=='Name') this.value='';" />
        <input name="email" type="text" value="Email address" onfocus="if(this.value=='Email address') this.value='';" />
        <input name="phonemodel" type="text" value="Phone model" onfocus="if(this.value=='Phone model') this.value='';" />
        <textarea name="comments" cols="" rows="" style="height:130px;" onfocus="if(this.value=='Type your message here.') this.value='';" >Type your message here.</textarea>
        <input type="image" name="button" value="Submit" src="../media/btn_play_submit.png" style="margin-right:5px; margin-top:12px;" />
</form>

PHP:

<?php
  if(isset($_POST['name'])) {

    $to = 'MYEMAILHERE';
    $headers = "From: blahblahblah\r\n";
    $subject = "Online Contact Submission Received\r\n";

    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phonemodel'];
    $comments = $_POST['comments'];

    $message .= "Name: " . $name . "\r\n";
    $message .= "Email: " . $email . "\r\n";
    $message .= "Phone Model: " . $phone . "\r\n";
    $message .= "Comments: " . $comments . "\r\n";

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

The email that I receive looks like this (and yes, I’m putting text in the fields…):

Name: undefined
Email: undefined
Phone Model:
Comments: undefined

First thing I notice: the “Phone Model” does not say “undefined” like the others. Second, why are the others saying undefined instead of the text I put in?

Thanks in advance.

  • 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-04T12:09:24+00:00Added an answer on June 4, 2026 at 12:09 pm

    Fixed it. Turns out it was going through some jQuery and then AJAX before getting to the PHP which is what was causing all of my problems.

    This is what happens when you get thrown into a project and don’t quite understand it. :/

    Thanks everyone.

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

Sidebar

Related Questions

Like the title says, I have the following exception: Description: Event code: 3005 Event
Like the title says, I've got a Child form being shown with it's TopLevel
Like the title says, I want to have a HTML table that allows its
Like the title says, my code basically does this: set proxy, test proxy, do
Like the title says: I have a DateTime start and a DateTime stop Now
Like the title says, how do you create custom code snippets in Visual Studio
Like the title says I want to use a color code instead of doing
Like the title says, whenever I make any changes in the code I don't
As title says, I have a yaml file with values like development: email:dev@abc.com test:
Just like the title says, Is there a simple line of code I could

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.