Results 1 to 1 of 1

Thread: Any errors in this PHP form submission script?

  1. #1
    Join Date
    Jul 2009
    Location
    Portlaoise, Ireland
    Posts
    22

    Any errors in this PHP form submission script?

    Hey guys. I can't quite get this script to work. As far as I know, I have it set up properly (ie. the form Action is emailformscript.php, and Method is POST).

    Code:
    <?php
    
    /* Subject and Email Variables */
    
    	$emailSubject = 'Crazy PHP Scripting!';
    	$webMaster = 'bob.lewisr@gmail.com';
    	
    /* Gathering Data Variables */
    
    	$nameField = $_POST('name');
    	$emailField = $_POST('email');
    	$phoneField = $_POST('phone');
    	$dealsField = $_POST('deals');
    	$additionalinfoField = $_POST('additionalinfo');
    	
    $body = <<<EOD
    <br><hr><br>
    Name: $name <br>
    Email: $email <br>
    Phone Number: $phone <br>
    Deals: $deals <br>
    Additional Info: $additionalinfo <br>
    EOD;
    
    	$headers = "From: $email\r\n";
    	$headers .= "Content-type: text/html\r\n";
    	$success = mail($webMaster, $emailSubject, $body, $headers);
    	
    /* Results rendered as HTML */
    	
    $theResults = <<<EOD
    <html>
    <head>
    <title>JakesWorks - travel made easy-Homepage</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    	background-color: #f1f1f1;
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	font-style: normal;
    	line-height: normal;
    	font-weight: normal;
    	color: #666666;
    	text-decoration: none;
    }
    -->
    </style>
    </head>
    
    <div>
      <div align="left">Thank you for your interest! Your email will be answered very soon!</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    	
    	
    ?>


    Can you see any discrepancies in my code? If you want to give it a go, go to www.icstestsite.com/contact and you can see what happens when I try to submit. Thanks!
    Last edited by LetJimiTakeOver; 19 Oct 2010 at 09:21 AM.

Similar Threads

  1. Flash mail form + php big problem
    By irka in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 09 Dec 2009, 07:00 AM
  2. Form Mailer - PHP Script - Data issue
    By dcj in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 28 Sep 2009, 09:44 PM
  3. PHP contact form script
    By femyram in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 30 Mar 2007, 01:58 PM

Posting Permissions

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