Displaying database content in custom page

Started by L.G.S, April 27, 2007, 05:00:45 PM

Previous topic - Next topic

L.G.S

I've got a database system set up where I go to a page to add something with a title and main body.

A default page which displayed all this would be:

http://www.ruthlessintent.com/website/cms/content.php

My problem is adding this content into my custom layout to have it appear in it.. I have this, which is the contents page, but when you click on it, it takes you to a blank html page with only the database content:

http://www.ruthlessintent.com/website/cms/index.php

What I want to do is have a clicked link to be in the same layout as the content... Here are my sources:

index.php (main template)

<?php require("/home/tscar/public_html/board/SSI.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
<!--
function mmLoadMenus() {
  if (window.mm_menu_0420225325_0) return;
    window.mm_menu_0420225325_0 = new Menu("root",129,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420225325_0.addMenuItem("Login","window.open('http://www.ruthlessintent.com/board/index.php?action=login', '_self');");
  mm_menu_0420225325_0.addMenuItem("Forum&nbsp;Index","window.open('http://www.ruthlessintent.com/board/', '_self');");
  mm_menu_0420225325_0.addMenuItem("Register","window.open('http://www.ruthlessintent.com/board/index.php?action=register', '_self');");
  mm_menu_0420225325_0.addMenuItem("Latest&nbsp;Posts","window.open('http://www.ruthlessintent.com/board/index.php?action=unread', '_self');");
   mm_menu_0420225325_0.fontWeight="bold";
   mm_menu_0420225325_0.hideOnMouseOut=true;
   mm_menu_0420225325_0.bgColor='#555555';
   mm_menu_0420225325_0.menuBorder=1;
   mm_menu_0420225325_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420225325_0.menuBorderBgColor='#777777';

      window.mm_menu_0420225918_0 = new Menu("root",202,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420225918_0.addMenuItem("Newest&nbsp;downloads","window.open('http://www.ruthlessintent.com/dl/newest.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Hottest&nbsp;downloads","window.open('http://www.ruthlessintent.com/dl/hottest.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("All&nbsp;categories","window.open('http://www.ruthlessintent.com/dl/all.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Music","window.open('http://www.ruthlessintent.com/dl/music.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Video","window.open('http://www.ruthlessintent.com/dl/video.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Data","window.open('http://www.ruthlessintent.com/dl/data.php', '_self');");
   mm_menu_0420225918_0.fontWeight="bold";
   mm_menu_0420225918_0.hideOnMouseOut=true;
   mm_menu_0420225918_0.bgColor='#555555';
   mm_menu_0420225918_0.menuBorder=1;
   mm_menu_0420225918_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420225918_0.menuBorderBgColor='#777777';

          window.mm_menu_0420230307_0 = new Menu("root",148,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420230307_0.addMenuItem("Latest&nbsp;reviews","window.open('http://www.ruthlessintent.com/rev/latest.php', '_self');");
  mm_menu_0420230307_0.addMenuItem("All&nbsp;categories","window.open('http://www.ruthlessintent.com/rev/all.php', '_self');");
  mm_menu_0420230307_0.addMenuItem("Video&nbsp;games","window.open('http://www.ruthlessintent.com/rev/', '_self');");
  mm_menu_0420230307_0.addMenuItem("Movies&nbsp;+&nbsp;Film","window.open('http://www.ruthlessintent.com/rev/movies.php', '_self');");
   mm_menu_0420230307_0.fontWeight="bold";
   mm_menu_0420230307_0.hideOnMouseOut=true;
   mm_menu_0420230307_0.bgColor='#555555';
   mm_menu_0420230307_0.menuBorder=1;
   mm_menu_0420230307_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420230307_0.menuBorderBgColor='#777777';

    window.mm_menu_0420231551_0 = new Menu("root",154,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0420231551_0.addMenuItem("Competitions","window.open('http://www.ruthlessintent.com/website/competitions.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Quote&nbsp;of&nbsp;the&nbsp;day","window.open('http://www.ruthlessintent.com/website/quote.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Site&nbsp;of&nbsp;the&nbsp;month","window.open('http://www.ruthlessintent.com/website/sotm.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Article&nbsp;of&nbsp;the&nbsp;moment","window.open('http://www.ruthlessintent.com/website/aotm.php', '_self');");
   mm_menu_0420231551_0.fontWeight="bold";
   mm_menu_0420231551_0.hideOnMouseOut=true;
   mm_menu_0420231551_0.bgColor='#555555';
   mm_menu_0420231551_0.menuBorder=1;
   mm_menu_0420231551_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420231551_0.menuBorderBgColor='#777777';

  window.mm_menu_0420231833_0 = new Menu("root",89,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0420231833_0.addMenuItem("Updates","window.open('http://www.ruthlessintent.com/website/updates.php', '_self');");
  mm_menu_0420231833_0.addMenuItem("Contact&nbsp;us","window.open('http://www.ruthlessintent.com/website/contact.php', '_self');");
   mm_menu_0420231833_0.fontWeight="bold";
   mm_menu_0420231833_0.hideOnMouseOut=true;
   mm_menu_0420231833_0.bgColor='#555555';
   mm_menu_0420231833_0.menuBorder=1;
   mm_menu_0420231833_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420231833_0.menuBorderBgColor='#777777';

mm_menu_0420231833_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>

<body><div align="center">
<script language="JavaScript1.2">mmLoadMenus();</script>
<div id="banner"><img src="images/banner.jpg" width="902" height="82" border="1" /></div>
<div id="menu">
  <table width="902px" border="0" cellpadding="0" cellspacing="0" background="images/menubg.gif">
    <tr>
      <td><img src="images/home.gif" name="image5" width="92" height="30" id="image5" onmouseover="MM_showMenu(window.mm_menu_0420231833_0,0,30,null,'image5')" onmouseout="MM_startTimeout();" /><img src="images/forums.gif" name="image1" width="129" height="30" id="image1" onmouseover="MM_showMenu(window.mm_menu_0420225325_0,0,30,null,'image1')" onmouseout="MM_startTimeout();" /><img src="images/downloads.gif" name="image2" width="202" height="30" id="image2" onmouseover="MM_showMenu(window.mm_menu_0420225918_0,0,30,null,'image2')" onmouseout="MM_startTimeout();" /><img src="images/reviews.gif" name="image3" width="148" height="30" id="image3" onmouseover="MM_showMenu(window.mm_menu_0420230307_0,0,30,null,'image3')" onmouseout="MM_startTimeout();" /><img src="images/extras.gif" name="image4" width="132" height="30" id="image4" onmouseover="MM_showMenu(window.mm_menu_0420231551_0,0,30,null,'image4')" onmouseout="MM_startTimeout();" /> <img src="images/menubg.gif" width="23" height="30" /><img src="images/menubg.gif" width="23" height="30" /><img src="images/menubg.gif" width="23" height="30" /><a href="/website/contact.php"><img src="images/contactus.gif" width="16" height="24" border="0" /></a><img src="images/menubg.gif" width="23" height="30" /><a href="/board/"><img src="images/forum.gif" width="16" height="24" border="0" /></a><img src="images/menubg.gif" width="23" height="30" /><a href="/website/sitemap.php"><img src="images/sitemap2.gif" width="16" height="24" border="0" /></a></td>
    </tr>
    <tr>
      <td background="images/website_10.gif">&nbsp;</td>
    </tr>
  </table>
</div>
<div id="conbox">
  <table width="697">
    <tr>
      <td background="images/website_10.gif"><br />
          <br /></td>
    </tr>
    <tr>
      <td background="images/conmiddle.gif" style="padding: 10px;"><?php include("http://www.ruthlessintent.com/website/cms/content.php"); ?></td>
    </tr>
    <tr>
      <td><img src="images/conbottom.jpg" width="697" height="17" /></td>
    </tr>
  </table>
</div>
<td><div id="navbox">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="images/navigation.gif" width="188" height="49" /></td>
    </tr>
    <tr>
      <td background="images/middle.gif"><table width="173" border="0" align="center">
        <tr>
          <td><?php include("http://www.ruthlessintent.com/website/cms/menu.php"); ?></td>
        </tr>
      </table>
            <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td>
    </tr>
    <tr>
      <td><img src="images/bottom.gif" width="188" height="33" /></td>
    </tr>
  </table>
</div></td>
<tr>
  <td><br />
      <br />
    <br /></td>
</tr></div>
</body>
</html>


content.php (the links to each article, however the actual content.php file is used as an include inside one of my tables in the main template)
<?php require("/home/tscar/public_html/board/SSI.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
<!--
function mmLoadMenus() {
  if (window.mm_menu_0420225325_0) return;
    window.mm_menu_0420225325_0 = new Menu("root",129,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420225325_0.addMenuItem("Login","window.open('http://www.ruthlessintent.com/board/index.php?action=login', '_self');");
  mm_menu_0420225325_0.addMenuItem("Forum&nbsp;Index","window.open('http://www.ruthlessintent.com/board/', '_self');");
  mm_menu_0420225325_0.addMenuItem("Register","window.open('http://www.ruthlessintent.com/board/index.php?action=register', '_self');");
  mm_menu_0420225325_0.addMenuItem("Latest&nbsp;Posts","window.open('http://www.ruthlessintent.com/board/index.php?action=unread', '_self');");
   mm_menu_0420225325_0.fontWeight="bold";
   mm_menu_0420225325_0.hideOnMouseOut=true;
   mm_menu_0420225325_0.bgColor='#555555';
   mm_menu_0420225325_0.menuBorder=1;
   mm_menu_0420225325_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420225325_0.menuBorderBgColor='#777777';

      window.mm_menu_0420225918_0 = new Menu("root",202,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420225918_0.addMenuItem("Newest&nbsp;downloads","window.open('http://www.ruthlessintent.com/dl/newest.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Hottest&nbsp;downloads","window.open('http://www.ruthlessintent.com/dl/hottest.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("All&nbsp;categories","window.open('http://www.ruthlessintent.com/dl/all.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Music","window.open('http://www.ruthlessintent.com/dl/music.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Video","window.open('http://www.ruthlessintent.com/dl/video.php', '_self');");
  mm_menu_0420225918_0.addMenuItem("Data","window.open('http://www.ruthlessintent.com/dl/data.php', '_self');");
   mm_menu_0420225918_0.fontWeight="bold";
   mm_menu_0420225918_0.hideOnMouseOut=true;
   mm_menu_0420225918_0.bgColor='#555555';
   mm_menu_0420225918_0.menuBorder=1;
   mm_menu_0420225918_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420225918_0.menuBorderBgColor='#777777';

          window.mm_menu_0420230307_0 = new Menu("root",148,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0420230307_0.addMenuItem("Latest&nbsp;reviews","window.open('http://www.ruthlessintent.com/rev/latest.php', '_self');");
  mm_menu_0420230307_0.addMenuItem("All&nbsp;categories","window.open('http://www.ruthlessintent.com/rev/all.php', '_self');");
  mm_menu_0420230307_0.addMenuItem("Video&nbsp;games","window.open('http://www.ruthlessintent.com/rev/', '_self');");
  mm_menu_0420230307_0.addMenuItem("Movies&nbsp;+&nbsp;Film","window.open('http://www.ruthlessintent.com/rev/movies.php', '_self');");
   mm_menu_0420230307_0.fontWeight="bold";
   mm_menu_0420230307_0.hideOnMouseOut=true;
   mm_menu_0420230307_0.bgColor='#555555';
   mm_menu_0420230307_0.menuBorder=1;
   mm_menu_0420230307_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420230307_0.menuBorderBgColor='#777777';

    window.mm_menu_0420231551_0 = new Menu("root",154,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0420231551_0.addMenuItem("Competitions","window.open('http://www.ruthlessintent.com/website/competitions.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Quote&nbsp;of&nbsp;the&nbsp;day","window.open('http://www.ruthlessintent.com/website/quote.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Site&nbsp;of&nbsp;the&nbsp;month","window.open('http://www.ruthlessintent.com/website/sotm.php', '_self');");
  mm_menu_0420231551_0.addMenuItem("Article&nbsp;of&nbsp;the&nbsp;moment","window.open('http://www.ruthlessintent.com/website/aotm.php', '_self');");
   mm_menu_0420231551_0.fontWeight="bold";
   mm_menu_0420231551_0.hideOnMouseOut=true;
   mm_menu_0420231551_0.bgColor='#555555';
   mm_menu_0420231551_0.menuBorder=1;
   mm_menu_0420231551_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420231551_0.menuBorderBgColor='#777777';

  window.mm_menu_0420231833_0 = new Menu("root",89,18,"Verdana, Arial, Helvetica, sans-serif",12,"#C3F6FF","#FFFFFF","#020003","#333333","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0420231833_0.addMenuItem("Updates","window.open('http://www.ruthlessintent.com/website/updates.php', '_self');");
  mm_menu_0420231833_0.addMenuItem("Contact&nbsp;us","window.open('http://www.ruthlessintent.com/website/contact.php', '_self');");
   mm_menu_0420231833_0.fontWeight="bold";
   mm_menu_0420231833_0.hideOnMouseOut=true;
   mm_menu_0420231833_0.bgColor='#555555';
   mm_menu_0420231833_0.menuBorder=1;
   mm_menu_0420231833_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0420231833_0.menuBorderBgColor='#777777';

mm_menu_0420231833_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>

<body><div align="center">
<script language="JavaScript1.2">mmLoadMenus();</script>
<div id="banner"><img src="images/banner.jpg" width="902" height="82" border="1" /></div>
<div id="menu">
  <table width="902px" border="0" cellpadding="0" cellspacing="0" background="images/menubg.gif">
    <tr>
      <td><img src="images/home.gif" name="image5" width="92" height="30" id="image5" onmouseover="MM_showMenu(window.mm_menu_0420231833_0,0,30,null,'image5')" onmouseout="MM_startTimeout();" /><img src="images/forums.gif" name="image1" width="129" height="30" id="image1" onmouseover="MM_showMenu(window.mm_menu_0420225325_0,0,30,null,'image1')" onmouseout="MM_startTimeout();" /><img src="images/downloads.gif" name="image2" width="202" height="30" id="image2" onmouseover="MM_showMenu(window.mm_menu_0420225918_0,0,30,null,'image2')" onmouseout="MM_startTimeout();" /><img src="images/reviews.gif" name="image3" width="148" height="30" id="image3" onmouseover="MM_showMenu(window.mm_menu_0420230307_0,0,30,null,'image3')" onmouseout="MM_startTimeout();" /><img src="images/extras.gif" name="image4" width="132" height="30" id="image4" onmouseover="MM_showMenu(window.mm_menu_0420231551_0,0,30,null,'image4')" onmouseout="MM_startTimeout();" /> <img src="images/menubg.gif" width="23" height="30" /><img src="images/menubg.gif" width="23" height="30" /><img src="images/menubg.gif" width="23" height="30" /><a href="/website/contact.php"><img src="images/contactus.gif" width="16" height="24" border="0" /></a><img src="images/menubg.gif" width="23" height="30" /><a href="/board/"><img src="images/forum.gif" width="16" height="24" border="0" /></a><img src="images/menubg.gif" width="23" height="30" /><a href="/website/sitemap.php"><img src="images/sitemap2.gif" width="16" height="24" border="0" /></a></td>
    </tr>
    <tr>
      <td background="images/website_10.gif">&nbsp;</td>
    </tr>
  </table>
</div>
<div id="conbox">
  <table width="697">
    <tr>
      <td background="images/website_10.gif"><br />
          <br /></td>
    </tr>
    <tr>
      <td background="images/conmiddle.gif" style="padding: 10px;"><?php include("http://www.ruthlessintent.com/website/cms/content.php"); ?></td>
    </tr>
    <tr>
      <td><img src="images/conbottom.jpg" width="697" height="17" /></td>
    </tr>
  </table>
</div>
<td><div id="navbox">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="images/navigation.gif" width="188" height="49" /></td>
    </tr>
    <tr>
      <td background="images/middle.gif"><table width="173" border="0" align="center">
        <tr>
          <td><?php include("http://www.ruthlessintent.com/website/cms/menu.php"); ?></td>
        </tr>
      </table>
            <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td>
    </tr>
    <tr>
      <td><img src="images/bottom.gif" width="188" height="33" /></td>
    </tr>
  </table>
</div></td>
<tr>
  <td><br />
      <br />
    <br /></td>
</tr></div>
</body>
</html>


What would I have to do? thanks

PS some of my html is probably wrong, i was going to check it once i had finished the main template ;)
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Advertisement: