PHP Heredoc unexpected end of file error -


this question has answer here:

i'm using heredoc in order save large block of html variable can send email. however, keep getting unexpected end of file syntax error. i've checked whitespace before closing heredoc tag , other common issues. appreciated!

here's full code:

<?php  include("init.php"); $email = "matthew910@gmail.com";  $body = <<<heredoc     <!doctype html> <html lang="en" style="height: 100%; font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="shortcut icon" href="https://d2jug8yyubo3yl.cloudfront.net/26999b2f-7c10-4962-918c-e964709e745d/e5d39140-5a3e-4177-9ff1-d7cf74cb6972.jpg"> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <!-- <meta name="viewport" content="width=device-width, initial-scale=1">--><!--<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />--><meta name="description" content=""> <meta name="author" content=""> <title>         el patron - home          </title> <!-- bootstrap core css - uses bootswatch flatly theme: http://bootswatch.com/flatly/ --><!-- custom css --><!-- magnific popup core css file --><!-- custom fonts --><!-- html5 shim , respond.js ie8 support of html5 elements , media queries --><!-- warning: respond.js doesn't work if view page via file:// --><!--[if lt ie 9]>         <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>         <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>     <![endif]--><script src="http://code.jquery.com/jquery-latest.min.js"></script><script src="http://www.minecraftserverland.com/elpatron/js/unslider.js"></script> </head> <body id="page-top" class="index" style="height: 100%; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-family: 'lato', 'helvetica neue', helvetica, arial, sans-serif; font-size: 13px; line-height: 1.42857143; overflow-x: hidden; margin: 0;" bgcolor="transparent !important">  <div style="min-height: 100%; position: relative; padding-bottom: 45px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;">     <!-- navigation --><!-- navigation --><nav class="navbar navbar-default" style="margin-bottom: 0px; margin-right: auto; margin-left: auto; height: 100px; position: fixed; z-index: 10000; top: 0px; background-color: transparent !important; display: none; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; min-height: 60px; text-transform: uppercase; font-family: trajan,'helvetica neue',helvetica,arial,sans-serif; font-weight: 700; width: 100%; left: 0; border: 0 solid transparent;"><div class="container" style="height: 100px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; width: 1170px;">              <div class="col-lg-12" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 100%;">                 <li class="page-scroll  " style="font-size: 12px; float: right; position: relative; right: 0px; top: 15px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; list-style-type: none;">                                                     <a href="http://www.minecraftserverland.com/elpatron/register.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; outline: 0;">login/register</a>                                             </li>         </div>             <!-- brand , toggle grouped better mobile display -->             <div class="navbar-header page-scroll" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-right: 0; margin-left: 0;">                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" style="background-color: transparent !important; color: #000 !important; overflow: visible; text-transform: none; -webkit-appearance: button; cursor: pointer; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; float: right; border-radius: 4px; display: none; font-style: normal; font-variant: normal; font-weight: normal; font-size: normal; line-height: normal; background-image: none; margin: 13px 15px 13px 0; padding: 9px 10px; border: 1px solid #1a242f;">                     <span class="sr-only" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); margin: -1px; padding: 0; border: 0;">toggle navigation</span>                     <span class="icon-bar" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block; width: 22px; height: 2px; border-radius: 1px;"></span>                     <span class="icon-bar" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block; width: 22px; height: 2px; border-radius: 1px; margin-top: 4px;"></span>                     <span class="icon-bar" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block; width: 22px; height: 2px; border-radius: 1px; margin-top: 4px;"></span>                 </button>                 <a class="navbar-brand" href="http://www.minecraftserverland.com/elpatron/index.php" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; font-size: 19px; line-height: 1; height: 60px; margin-left: -15px; outline: 0; padding: 18px 15px 19.5px;"><img style="height: 54px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; page-break-inside: avoid; max-width: 100% !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; vertical-align: middle; display: block; border: 0;" src="http://www.minecraftserverland.com/elpatron/img/patronlogo.black.png"></a>             </div>              <!-- collect nav links, forms, , other content toggling -->             <div class="collapse navbar-collapse blackbackground" id="bs-example-navbar-collapse-1" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block !important; overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top-width: 0; border-top-style: solid; -webkit-overflow-scrolling: touch; width: auto; height: auto !important; padding-bottom: 0; overflow: visible !important; margin-right: 0; margin-left: 0; border: transparent;">                 <ul class="nav navbar-nav navbar-right" style="padding-top: 25px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding-left: 0; float: right !important; letter-spacing: 1px; list-style-type: none; margin: 0 -15px 0 0;"> <li class="hidden" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: none !important; float: left;">                         <a href="#page-top" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;"></a>                     </li>                     <li class="page-scroll  " style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; float: left;">                         <a href="http://www.minecraftserverland.com/elpatron/collection.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;">collection</a>                     </li>                     <li class="page-scroll  " style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; float: left;">                         <a href="http://www.minecraftserverland.com/elpatron/lifestyle.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;">lifestyle</a>                     </li>                     <li class="page-scroll  " style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; float: left;">                         <a href="http://www.minecraftserverland.com/elpatron/education.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;">education</a>                     </li>                     <li class="page-scroll  " style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; float: left;">                         <a href="http://www.minecraftserverland.com/elpatron/professional.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;">professional</a>                     </li>                                                 <li class="page-scroll " style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; float: left;">                         <a href="http://www.minecraftserverland.com/elpatron/cart.php" style="color: #000 !important; background-color: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; display: block; line-height: 21px; outline: 0; padding: 19.5px 15px 10px;"><i class="fa fa-shopping-cart" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: inline-block; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 1; font-family: fontawesome;"></i> 0  </a>                     </li>                    </ul> </div>             <!-- /.navbar-collapse -->         </div>         <!-- /.container-fluid -->     </nav><div style="width: 100%; height: 100px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;">  </div>      <div id="login" class="row white-popup mfp-hide text-center" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; text-align: center; display: none !important; position: relative; width: auto; max-width: 400px; min-width: 300px; border-radius: 0px; margin: 20px auto; padding: 35px 20px 25px; border: 3px solid #2c2c2c;" align="center">                     <h3 style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; orphans: 3; widows: 3; page-break-after: avoid; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-family: trajan,'helvetica neue',helvetica,arial,sans-serif; font-weight: 700; line-height: 1.1; margin-top: 21px; margin-bottom: 10.5px; font-size: 26px; text-transform: uppercase;">                         check out our spotify playlist                     </h3>                     <hr class="dark" style="-moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; height: 1px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; margin-top: 0; margin-bottom: 21px; border-top-color: #ecf0f1; border-top-style: solid; background-image: linear-gradient(to right, #ccc, #333, #ccc); border: 0;"> <img src="http://www.minecraftserverland.com/elpatron/img/spotify.png" style="width: 70%; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; page-break-inside: avoid; max-width: 100% !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; vertical-align: middle; border: 0;"> </div>           <script style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"> function getcookie(name) { var arg=name+"="; var alen=arg.length; var clen=document.cookie.length; var i=0; while (i<clen) { var j=i+alen; if (document.cookie.substring(i,j)==arg) return "here"; i=document.cookie.indexof(" ",i)+1; if (i==0) break; } return null; }  // -->  </script><script style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"> jquery(window).load(function(){ var visit=getcookie("cookie1"); if (visit==null){ var expire=new date();   jquery.magnificpopup.open({   items: {src: '#login'},type: 'inline'}, 0);   expire=new date(expire.gettime()+7776000000); document.cookie="cookie1=here; expires="+expire; }  }); </script><section style="display: block; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 25px 0 50px;"><div class="container" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; width: 1170px;">          <div class="col-lg-12 text-center" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; text-align: center; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 100%;" align="center">             <h2 class="mainheader" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; orphans: 3; widows: 3; page-break-after: avoid; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-family: trajan,'helvetica neue',helvetica,arial,sans-serif; font-weight: 700; line-height: 1.1; font-size: 2.2em; text-transform: uppercase; margin: 0;">                 welcome             </h2>             <hr class="dark" style="-moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; height: 1px; background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; margin-top: 0; margin-bottom: 21px; border-top-color: #ecf0f1; border-top-style: solid; background-image: linear-gradient(to right, #ccc, #333, #ccc); border: 0;"> </div>      </div>     <!-- jquery -->     <script src="http://www.minecraftserverland.com/elpatron/js/jquery.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script><script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script><!-- bootstrap core javascript --><script src="http://www.minecraftserverland.com/elpatron/js/bootstrap.min.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script><!-- plugin javascript --><script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script><!--  <script src="js/classie.js"></script>      <script src="js/cbpanimatedheader.js"></script> --><!-- contact form javascript      <script src="js/jqbootstrapvalidation.js"></script>     <script src="js/contact_me.js"></script>     --><!-- custom theme javascript --><script src="http://www.minecraftserverland.com/elpatron/js/freelancer.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script><!-- magnific popup core js file --><script src="http://www.minecraftserverland.com/elpatron/js/jquery.magnific-popup.js" style="background-color: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"></script></section> </div> </body> </html> heredoc;   echo $email . "<br>"; email($email, "sponsored bidding", $body);    ?> 

that specific error can result white-space / tab indentation on same line after closing heredoc: people catch opening white-space issue, 1 harder see.

when in doubt heredoc blocks try , eliminate possible white-space , indentations.

possible dupe: why these heredoc , nowdoc cause errors?


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -