erisande Posted December 28, 2004 Posted December 28, 2004 Code I am trying to run: ><?PHP if (isset($_POST['stage']) && ('process' == $_POST['stage'])) { process_form(); } else { print_form(); } function print_form() { echo <<< END <form action="$_SERVER[PHP_SELF]" method="post"> First Name? <input type="text" name="first_name"> <input type="submit" value="Submit"> <input type="hidden" name="stage" value="process"> </form> END; } function process_form() { echo 'Hello ' . $_POST['first_name'] . '!'; } ?> Can anyone explain why I don't get an error and the Source lists only: ><html><body></body></html> Funny I don't ever see PHP errors anymore, instead, I get blank pages with the same source listed above. Quote
TCH-Don Posted December 28, 2004 Posted December 28, 2004 (edited) The terminator for the heredoc must be the first thing on the line imediatly followed by the ; you have a space in front of the terminator. >echo <<< END <form action="$_SERVER[PHP_SELF]" method="post"> First Name? <input type="text" name="first_name"> <input type="submit" value="Submit"> <input type="hidden" name="stage" value="process"> </form> END; } remove space above before END Edited December 28, 2004 by TCH-Don Quote
erisande Posted December 28, 2004 Author Posted December 28, 2004 *Slaps Forehead Repeatedly* Thanks! I killed myself for hours over that! I wish I would have goten some error messages to help out; instead, all I got was a blank screen. THAT was annoying! Bow to master.... Quote
TCH-Rob Posted December 28, 2004 Posted December 28, 2004 erisande, What do you code with? Have you thought of using a color coded editor so you can visually see if there is an issue? Quote
borfast Posted December 29, 2004 Posted December 29, 2004 Erisande, if you want to see the errors, you may want to put error_reporting(E_ALL); at the top of the script. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.