Php Recent Oddities

Code I am trying to run:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?PHP<br />if (isset($_POST['stage']) && ('process' == $_POST['stage']))<br />{<br /> process_form();<br />} else {<br /> print_form();<br />}<br /><br />function print_form()<br />{<br /> echo <<< END<br />   <form action="$_SERVER[PHP_SELF]" method="post"><br />   First Name?<br />  <input type="text" name="first_name"><br />  <input type="submit" value="Submit"><br />  <input type="hidden" name="stage" value="process"><br />  </form><br />  END;<br />}<br /><br />function process_form()<br />{<br /> echo 'Hello ' . $_POST['first_name'] . '!';<br />}<br /> <br />?><!--c2--></div><!--ec2--><br />Can anyone explain why I don't get an error and the Source lists only:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><html><body></body></html><!--c2--></div><!--ec2-->Funny I don't ever see PHP errors anymore, instead, I get blank pages with the same source listed above.<!--content-->
The terminator for the heredoc must be the first thing on the line imediatly followed by the ;<br /><br />you have a space in front of the terminator.<br /><br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->echo <<< END<br />  <form action="$_SERVER[PHP_SELF]" method="post"><br />  First Name?<br /> <input type="text" name="first_name"><br /> <input type="submit" value="Submit"><br /> <input type="hidden" name="stage" value="process"><br /> </form><br />  END;<br />}<!--c2--></div><!--ec2--><br /><br /><br />remove space above before END<!--content-->
*Slaps Forehead Repeatedly*<br /><br />Thanks! I killed myself for hours over that!<br /><br />I wish I would have goten some error messages to help out; instead, all I got was a blank screen. THAT was annoying!<br /><br />Bow to master....<!--content-->
erisande,<br /><br />What do you code with? Have you thought of using a color coded editor so you can visually see if there is an issue?<!--content-->
Erisande, if you want to see the errors, you may want to put <a href="http://php.net/error_reporting" target="_blank">error_reporting(E_ALL);</a> at the top of the script.<!--content-->
 
Top