Parse error: syntax error, unexpected T_VARIABLE in LINE 27

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Graviz
    New Member
    • Apr 2010
    • 2

    Parse error: syntax error, unexpected T_VARIABLE in LINE 27

    I am gettin a error message on this script can someone help me. I can't see what is wrong. Thanks in advance for any help you can give me.
    here is the error and code.

    Parse error: syntax error, unexpected T_VARIABLE in /home/a4284579/public_html/contactformphp. php on line 27

    Code:
    <?php
    
    /* Subject and Email Variables*/
    
    	$emailSubject = 'Client Information Scripting!';
    	$webMaster = 'gravizdesign@live.com';
    	
    /*Gathering Data Variables*/
    
    	$emailField = $_POST['email'];
    	$nameField = $_POST['name'];
    	$messageField = $_POST['message'];
    	
    	$body = <<<EOD
    <br><hr><br>
    Email: $email<br>
    Name: $name<br>
    Message: $message<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>Thesiscomplete.ie - Thesis bounding made easy</title>
    <meta http-equiv="refresh" content"5;URL=http://thesiscomplete.ie/contactus.html">
    <style type="text/css">
    <!--
    body {
    	background-color: #444;
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 16px;
    	font-style: normal;
    	line-height: normal;
    	font-weight: normal;
    	color: #fec001;
    	text-decoration: none;
    	padding-top: 200px;
    	margin-left: 200px
    	width: 800px
    }
    -->
    </style>
    </head>
    
    <div>
    <div align="centre">Your email will be answered as soon as possible. You will be returned to Thesiscomplete in a few seconds!</div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    
    ?>
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    It means there is a syntax error on line 27 (or possibly earlier).
    Enclose in CODE tags and tell us which is line 27

    Comment

    • Graviz
      New Member
      • Apr 2010
      • 2

      #3
      line 27 is the following $theResults = <<<EOD

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        The error is on this line
        Code:
        $success = mail($webMaster, $emailSubject, $body, $headers

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          There also seem to be spaces following the "<<<EOD" on the line you indicated. You need to remove them. - Nothing can follow the starting delimiter of an Heredoc string. Not until the next line, that is.

          Comment

          Working...