SyntaxFix
Write A Post
Hire A Developer
Questions
You could try:
<a href="<?php echo $directory ?>">The link to the file</a>
Or for PHP 5.4+ (<?= is the PHP short echo tag):
<?=
<a href="<?= $directory ?>">The link to the file</a>
But your path is relative to the server, don't forget that.