Try something like:
<?php
if($row_rsemalpha['URL'] != NULL){
$buttonCode = '<a href="http://'.$row_rsemalpha['URL'].'" target ="_blank"><img src="web_button_on.gif" alt="Website" border="0" height="18" width="103"></a>';
}else{
$buttonCode = '<img src="web_button_off.gif" alt="No Website Available" height="18" width="103"/>';
}
echo $buttonCode;
?>