Remember that HEREDOC stops parsing when it reads the original start word and must begin without and spaces. That is, THEHTML in the end must start without any tabs or indents for HEREDOC to work. Most people make this mistake and don't understand why their code never worked. Just a heads up!