Looks like you're using a custom system right? Yup,
<? if($logged<>"yes"){
// do things for logged in people
} ?>
Also, all those uses of print is messy.
Where you have multiple instances of print ""; to display html, you can just condense them all into a single print "";, or just remove print altogether and put php tags around the php.