<HTML>
 <HEAD>
  <TITLE>
   Menu frame
  </TITLE>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
  <CENTER>
   <H3>
    What would you like to know?
   </H3>
  </CENTER>
  <CENTER>
   <TABLE COLS="1">
   <? // get the links
      mysql_pconnect("localhost","root","redrum1");
      $db="site";
      $table="menu";
      $getlinks="SELECT * FROM $table ORDER BY menu_id";
      $result=mysql_db_query($db,$getlinks);
      if (!$result) {
        echo "<TR><TD>No menu</TR></TD>";
      }
      else {
          while ($row=mysql_fetch_row($result))
          {
           $link_id=$row[0];
           $name=$row[1];
           $url=$row[2];
           echo "<TR><TD><A HREF=\"$url\" TARGET=\"main_frame\">$name</A></TD><TR>\n";
          }
      }
    ?>
    <TR>
     <TD>
      <A HREF="../misc/guestbook.php" TARGET="main_frame">Guestbook</A>
      <? // get the latest entry 
         mysql_pconnect("localhost","root","redrum1");
         $db="guestbook";
         $table="simple_guestbook";
         $getlatest="SELECT date_posted,user_name,user_email from $table ORDER BY message_id DESC";
         $result=mysql_db_query($db,$getlatest);
         $row=mysql_fetch_row($result);
         $date=$row[0];
         $user_name=$row[1];
         $user_email=$row[2];
         echo "<FONT SIZE=\"-2\">(Last entry by $user_name(<A HREF=\"mailto:$user_email\">$user_email</A>) on $date)";
      ?>
     </TD>
    </TR>
   </TABLE>
  </CENTER>
 </BODY>
</HTML>
