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 4 of 4

Thread: i need help

  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    67
    Thanks
    12
    Thanked 1 Time in 1 Post

    i need help

    i have written a php code which submits a form to my email address for some reason instead of sending the data that has been inputted it sends:
    <br><hr><br>
    Email: <br>
    Account number: <br>
    Company: <br>
    Order: <br>
    i am wondering if you can help me fix this thanks
    here is the whole code:
    Code:
    <?php
    
    /* SUBJECT AND EMAIL*/
    
    	$emailSubject = 'Order';
    	$webMaster = 'cal.bramley@googlemail.com';
    	
    /* Gathering Data Variables */
    	$company = $_POST['company'];
    	$order = $_POST['order'];
    	$email = $_POST['Email'];
    	$accountnumber = $_POST['account number'];
    	
    	
    	$body = <<<EOD
    <br><hr><br>
    Email: $email <br>
    Account number: $accountnumber <br>
    Company: $company <br>
    Order: $order <br>
    EOD;
    
    	$headers = "From: $email\r\n";
    	$headers .= "Conetent-type: text/html\r\n";
    	$success = mail($webMaster, $emailSubject, $body, $headers);
    	
    
    ?>

  • #2
    New Coder
    Join Date
    Apr 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can i have a look at the form from where you are taking the values like
    PHP Code:
    $company $_POST['company'];
        
    $order $_POST['order'];
        
    $email $_POST['Email'];
        
    $accountnumber $_POST['account number']; 

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    67
    Thanks
    12
    Thanked 1 Time in 1 Post
    Quote Originally Posted by php_rockzz View Post
    can i have a look at the form from where you are taking the values like
    PHP Code:
    $company $_POST['company'];
        
    $order $_POST['order'];
        
    $email $_POST['Email'];
        
    $accountnumber $_POST['account number']; 
    the code for the form is below:
    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=iso-8859-1" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    #Layer1 {
    	position:absolute;
    	width:112px;
    	height:73px;
    	z-index:1;
    	left: 49px;
    	top: 14px;
    }
    body {
    	background-color: #000000;
    }
    #Layer2 {
    	position:absolute;
    	width:200px;
    	height:115px;
    	z-index:2;
    	left: 211px;
    	top: 115px;
    }
    #Layer3 {
    	position:absolute;
    	width:200px;
    	height:115px;
    	z-index:3;
    	left: 7px;
    	top: 114px;
    }
    .style1 {color: #FFFFFF}
    -->
    </style>
    </head>
    
    <body>
    <div id="Layer2">
    <form action="process.php" method="post">
      <p>
        <input name="Email" type="text" id="Email" />
    </p>
      <p>
        <input name="account number" type="text" id="account number" />
      </p>
      <p>
          <input type="text" name="company" />
        Company: 
        <br />
        <textarea name="order" cols="50" rows="8"></textarea>
      </p>
      <label for="Submit"></label>
      <input type="submit" name="Submit" value="Submit" id="Submit" />
      Or
    
    der: 
    </form>
    </div>
    <div id="Layer1"><img src="http://images.thomann.de/pics/herstlogos/gewa.gif" width="154" height="89" alt="Logo" /></div>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <div id="Layer3">
      <div align="right">
        <p class="style1">Email of user: </p>
        <p class="style1">Account Number: </p>
        <p class="style1"> Company:</p>
        <p class="style1">Order:</p>
      </div>
    </div>
    <p>&nbsp;</p>
    </body>
    </html>

  • #4
    New Coder
    Join Date
    Apr 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ur code is working fine over here except that its not getting the value of the account number..

    The reason is because it has a space between account and number..
    replace and use as:
    Code:
    <input name="account_number" type="text" id="account_number" />
    PHP Code:
    $accountnumber $_POST['account_number']; 
    When i echo the $body, im getting the input values as the output..


  •  

    Posting Permissions

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