petterruud Posted July 2, 2007 Share Posted July 2, 2007 im doing a cms with adminpanel where you can change 2 templatebits, "i_htmltopp" the top html file and "i_htmlbunn" the bottom html file. All my php is either in includes in the html top file or between the two html files. the two templatebits are saved inside a mysql tabel called template, im fetching them from the mysql by running $htmltopp="SELECT * FROM template WHERE tempnavn='i_htmlbunn'"; $htmltopp2=mysql_query($htmltopp) or die ("fant ikke template"); $htmltopp3=mysql_fetch_array($htmltopp2); print "$htmltopp3[temptekst]"; it prints the html, but not the php for example <?php include "i_vnav.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 name="Description" content="" /> <meta name="Keywords" content="Web Design,css,Koding,php,mysql,xhtml,javascript,photoshop,Web Standards." /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="Distribution" content="Global" /> <meta name="Author" content="Petter Ruud - [email protected]" /> <meta name="Robots" content="index,follow" /> <meta name="revisit-after" content="20 Days" /> <meta name="copyright" content="Copyright (c) 2007 Dogme Design" /> <link href="favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="stil.css" type="text/css" /> <title>Dogme Design</title> </head> <body> <!-- wrap starts here --> <div id="wrap"> <div id="header"> <img src='bilder/logo.png' alt='Dogme Design' /> <form action='i_sok.php' method='post' class="searchform"> <p><input type='text' name='phrase' class="textbox" /> <input type='submit' name='submit' class="button" value="Søk" /></p> </form> <!-- Menu Tabs --> <ul> <li><a href='index.php'><span>Hjem</span></a></li> <?php include "i_tnav.php" ; ?> <li><a href="i_kontakt.php"><span>Kontakt</span></a></li> </ul> </div><!-- content-wrap starts here --> <div id="content-wrap"> <div id="sidebar"> <h1>Navigasjon</h1> <ul class="sidemenu"> <li><a href='index.php'>Hjem</a></li> <?php include "i_vnav.php" ; ?> <li><a href="i_kontakt.php">Kontakt</a></li> </ul> <h1>Brukermeny</h1> <ul class="sidemenu"> <?php include "i_brukermeny.php"; ?> </ul> <h1>Litt Statestikk</h1> <p> <?php include "i_online.php";?> </p> </div> <div id="main"> Link to comment https://forums.phpfreaks.com/topic/58008-retrieving-text-include-filephp-from-mysql/ Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 <?php include "i_vnav.php" ; ?> can we see the code for that Link to comment https://forums.phpfreaks.com/topic/58008-retrieving-text-include-filephp-from-mysql/#findComment-287519 Share on other sites More sharing options...
petterruud Posted July 2, 2007 Author Share Posted July 2, 2007 i_vnav.php <?php include 'dbtilkobling.php'; $getallpages="SELECT * from pagecats order by pagecatorder ASC"; $getallpages2=mysql_query($getallpages) or die(mysql_error()); while($getallpages3=mysql_fetch_array($getallpages2)) { print "<li><A href='$sitepath/i_side.php?ID=$getallpages3[pagecatid]'>$getallpages3[pagecatname]</a></li>"; } ?> Link to comment https://forums.phpfreaks.com/topic/58008-retrieving-text-include-filephp-from-mysql/#findComment-287856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.