Jump to content

retrieving text (include "file.php") from mysql


petterruud

Recommended Posts

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 - petterruud@gmail.com" />
<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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.