The better solution than either is:
PHP Code:
<?php if ($_SESSION['customer_id'] <= 0) { ?>
<a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><img src="images/header_04.jpg" width="97" height="28" border="0" alt=""></a>
<?php } else { ?>
<a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><img src="images/header_04b.jpg" width="97" height="28" border="0" alt=""></a>
<?php } ?>
This runs the right image and does it with the secure/non-secure ability etc.