It's not about your heredoc, it's just a wrong using of variable name inside a string of PHP.
String doesn't let you put array element directly inside it without curry braces.
Try this:
$stringData = <<<EOD
<a href="{$_POST['title']}.html">{$_POST['title']}</a><br> \n
EOD;