Try this to see if it works.
$disp = $display['p'];
$f = "<td><a href = '$disp'>$disp</a></td>";
It at least looks a lot clearer than before.
Also some good advice is to post any error messages along with the code that is being the problem. It helps people to help you.
Hope this helps.