Bulding on the code in your original example, this is how you do it (see how CODE is kept apart from STRING LITERALS?)
session_start();
if(isset($_SESSION['userid']))
{
/* Instead of wrapping strings inside "" or '', you might want to use heredoc or nowdoc,
* since they allow you to have both " and ' inside the string without escaping them
* by usng \" and \'
* You can use any identifier you wish, in this case html. For heredoc, which uses string
* interpolation just like double quoted strings do, the syntax is <<<identifier and
* for nowdoc, which doesn't use string interpolation, the syntax is <<<'identifier'
*/
$content= <<<'html'
<!-- no such tag -->
</br>
<!-- Why do you close an element that isn't part of $content inside $content?
Keep ONLY content inside content, and the structure inside content should
NEVER be dependendt on stuff outside content.
If you need to close a tag, opened before content and before content is displayed,
then close it before you assign stuff to $content.
If you need to close a tag opened before content, but after content has been
displayed, do so after $content.
-->
</center>
<form id='comment' action='comment_check.php' method='post' accept-charset='UTF-8'>
<input type='hidden' name='id' id='id' />
<!-- No such tag -->
</br>
<input type='text' name='title' id='title' /><b><font color='#ffffff' size='3' face='arial'>
Title</font></b>
<textarea rows='5' cols='93' wrap='physical' name='description' id='description'>
</textarea>
<!-- no such tag -->
</br>
<!-- This causes improper nesting of tags. This td was NOT opened inside your form,
which means that you get the following structure
<td><form></td></form>
which makes absolutely no sense
-->
</td>
<!-- same as above...
</tr>
<tr>
<td align='right'><input type='reset' name='reset' value='Reset' /><input type='submit' name='Submit' value='Submit' />
<!-- and now you've opened a tr inside the form but do not close it. improper nesting once again.
</form>
html;
# here you use the above specified identifier to end the string. It MUST begin a new line
}
else
{
$content = '';
}
Do note the comments in the html code since they point out html errors. You really should validate your code here.