may be even easier to switch into php mode only when you need the variable, writing all static output in html:
<td><a href="deleteproduct.php?delkey=<?php echo $deletekey; ?>"><img src="/pictures/trash.jpg" border=0 target=_self align="centre"></td>
also, you don't close the <a> tag, is this on purpose?