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
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Empty email on php contact form…

    I'm really having a hard time to make a simple php contact form work. I don't get anny fild in forms back in my email inbox and no sender. the email is just allmost empty an fild with blancs No text is send to my email;
    Subject: Contact
    Datum: 24 maart 2009 17:16:00 GMT+01:00
    To: d.hommelen@gmail.com
    From: (<<<here's sepose to be an email adress)


    Naam:
    Onderwerp:
    Email:
    Bericht:

    Where are the fild in Fields that you fil in on the
    Code:
    <?php
    
    	$emailSubject = 'Contact';
    	$webMaster = 'd.hommelen@gmail.com';
    	
    	$naamField = $_POST['naam'];
    	$onderwerpField = $_POST['onderwerp'];
    	$emailField = $_POST['email'];
    	$berichtField = $_POST['bericht'];
    
    	$body = <<<EOD
    <br><hr><br>
    Naam: $naam <br>
    Onderwerp: $onderwerp <br>
    Email: $email<br>
    Bericht: $bericht <br>
    EOD;
    
    	$headers = "From: $email\r\n";
    	$headers .= "Content-type: text/html\r\n";
    	$success = mail($webMaster, $emailSubject, $body, $headers);
    	
    	$theResults = <<<EOD
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>lonneke ten hooven - koken op maat</title>
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="sidebar"> <a href="index.html"><img src="_media/logoKokenOpMaat.gif" width="345" height="110" alt="Logo Lonneke ten Hooven Koken op Maat" /></a><img src="_media/sidebarContact.jpg" width="345" height="600" alt="koken op locatie" />
      </div>
      <div id="header">  
        <ul>
        <li><a href="koken_op_maat/koken_op_maat.html">koken op maat</a></li>
        <li><a href="thema_menu/thema_menu.html">thema menus</a></li>
      	<li><a href="work_shops/work_shops.html">work shops</a></li>
        <li><a href="patisserie/patisserie.html">patisserie</a></li>
      </ul>
      </div>
      <div id="mainContent">
        <h1>Contact</h1>
        <p>&nbsp;</p>
        <p>Bedank voor uw bericht.</p>
    <p>&nbsp;</p>
      </div>
      <div id="footer"> 
        <ul>
          <li>Telefoon: +31 (0) 6 22 555877 <a href="mailto:info@lonnekekokenopmaat.nl">info@lonnekekokenopmaat.nl</a> <a href="contact.html">contact</a></li>
        </ul>
      </div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    
    ?>

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Add Field to the end of your variables!
    PHP Code:
    $naamField $_POST['naam'];
        
    $onderwerpField $_POST['onderwerp'];
        
    $emailField $_POST['email'];
        
    $berichtField $_POST['bericht'];

        
    $body = <<<EOD
    <br><hr><br>
    Naam: $naam <br>
    Onderwerp: $onderwerp <br>
    Email: $email<br>
    Bericht: $bericht <br> 

  • Users who have thanked rafiki for this post:

    dhummelen (03-24-2009)

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I overlooked it. Thanks for pointing it out. Staring at a screen all day can make you blind.


  •  

    Posting Permissions

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