I figured it out, thanks.
for those interested I was actually embedding html inside a <textarea></textarea>. The problem was when I put a textarea inside those two tags the ending textarea </textarea> would end the first one.
observe:
<textarea>
<textarea>
</textarea> <- This text area tag stopped the first one, not the second.
</textarea>
All I had to do was use the php function htmlentities(). For more information check
here .