Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP form some part email showing blank

    I can figure this out why email some form values are not showing up why not everything look right.

    This is the way my email look when I get them the names are not showing.

    Northern Region Freight Contact US
    ...
    From:
    Nobody
    ...
    Add to Contacts
    To: usatrucker20076@yahoo.com


    First name:
    Last name:
    Email: gamer2456@live.com
    Support type: Question
    Other:
    Comments: how the everthing.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Northern Region Freight Contact US</title>
    <style type="text/css">
    <!--
    body {
    	background-color: #386643;
    	background-image: url(images/bg1.gif);
    	background-repeat: repeat-x;
    }
    -->
    </style>
    <link href="css/layout.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id="wrapper">
      <div id="logo"><img src="images/NRFlogo.jpg" alt="NRFlogo" width="980" height="200" /></div>
      <div id="navigation"></div>
      <div id="bodyArea">
        <div id="content"> <p align="center">&nbsp;</p>
          <form action="contactformprocess.php" method="post" name="form1" id="form1">
            <p align="left"><strong>        FirstName *        </strong>        </p>
            <p align="left">
              <input name="firstname" type="text" id="firstname" size="35" />
            </p>
            <p align="left">&nbsp;</p>
            <p align="left"><strong>Last Name* </strong></p>
            <p align="left">
              <input name="lastname" type="text" id="lastname" size="35" />
            </p>
            <p align="left">&nbsp;</p>
            <p align="left"><strong>Email *</strong></p>
            <p align="left">
              <input name="email" type="text" id="email" size="35" />
            </p>
            <p align="left">&nbsp;</p>
            <p align="left"><strong>Please Select Type of Support From list below</strong></p>
            <p align="left">
              <select name="supporttype" id="supporttype">
                <option selected="selected">Select one</option>
                <option value="Question">Question</option>
                <option value="Technical Support">Technical Support</option>
                <option value="Other">Other</option>
              </select>
            </p>
            <p align="left">&nbsp;</p>
            <p align="left"><strong>IF other please type it below</strong></p>
            <p align="left">
              <input name="other" type="text" id="other" size="35" />
            </p>
            <p align="left">&nbsp;</p>
            <p align="left">
              <textarea name="comments" id="comments" cols="45" rows="5"></textarea>
            </p>
            <p align="left">&nbsp;</p>
            <p align="left">
              <input type="submit" name="submit" id="submit" value="Submit" />
              <input type="reset" name="reset" id="reset" value="Reset" />
            </p>
            <p>&nbsp;</p>
          </form>
          
          <p>&nbsp;</p>
        </div>
        <div id="footer"></div>
      </div>
    </div>
    </body>
    </html>
    Code:
    <?php
    /* Subject and Email Veriables */
    
            $emailSubject = "Northern Region Freight Contact US";
            $webMaster = "usatrucker20076@yahoo.com";
    
    /* Gathering Data Veriables */
    
            $firstnameField = $_POST['first name'];
    		$lastnameField = $_POST['last name'];
    		$emailField = $_POST['email'];
    		$supporttypeField = $_POST['support type'];
    		$otherField = $_POST['other'];
    		$commentsField = $_POST['comments'];
    				      
    $body = "";
    $body .= "<br>";
    $body .= "<hr>";
    $body .= "<br>";
    $body .= "Firstname: " . $_POST['first name'] . "<br>\n";
    $body .= "Lastname: " . $_POST['last name'] . "<br>\n";
    $body .= "Email: " . $_POST['email'] . "<br>\n";
    $body .= "Supporttype: " . $_POST['support type'] . "<br>\n";
    $body .= "Other: " . $_POST['other'] . "<br>\n";
    $body .= "Comments: " . $_POST['comments'] . "<br>\n";
    		
            $headers = "From: $email\r\n";
            $headers .= "Content-type: text/html\r\n";
            $success = mail("$webMaster", "$emailSubject", "$body", "$headers");
    
    /* Results rendered as HTML */
    
    $theResults = <<<EOD2
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Northern Region Freight </title>
    <style type="text/css">
    <!--
    body {
    	background-color: #386643;
    	background-image: url(images/bg1.gif);
    	background-repeat: repeat-x;
    }
    -->
    </style>
    <link href="css/layout.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id="wrapper">
      <div id="logo"><img src="images/NRFlogo.jpg" alt="NRFlogo" width="980" height="200" /></div>
      <div id="navigation"></div>
      <div id="bodyArea">
        <div id="content">
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">Thank you For your interest in Northern Region Freight we will </p>
          <p align="center">get back to you with 24 hours of submission.</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center"><br />
          </p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
        </div>
        <div id="footer"></div>
      </div>
    </div>
    </body>
    </html>
    
    EOD2;
    
    echo $theResults;
    
    ?>
    Last edited by newtocode; 10-11-2009 at 07:36 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
      <input name="firstname" type="text" id="firstname" size="35" />
    Code:
    $firstnameField = $_POST['first name'];
    		$lastnameField = $_POST['last name'];
    Isn't that obvious? I'd recommend to use a strict error reporting and turn on the reporting while development.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    see form problem php

    works.

    new thread not really needed


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •