the way i have solved this is to have another column of data_type.
switch ($data_type) {
case "php":
exec($data);
break;
case "html":
include($data);
break;
}
mike
on 7/31/01 3:24 PM, Kyle at [EMAIL PROTECTED] wrote:
> For example I have in a database:
> ----------------------------- In database:
> <html><head><title>welcome</title></head>
> <body>
> <?
> if ($something == 'hello') {
> echo 'do somethoing';
> }?>
> ------------------------------ Also in Database:
> </body></html>
> -------------------------------
> Now how could i make it so that I have another page that has the following:
> -------- index.php ---------
> <?
> $db = mysql_connect ($dbhost,$dbuser,$dbpass);
> $query = "SELECT code FROM templates WHERE name = 'header'";
> $result = mysql_db_query($dbtabe,$query);
> $row = mysql_fetch_array ($result);
> echo $row[code];
> ?>
> Jump out and have some html content
> <?
> $db = mysql_connect ($dbhost,$dbuser,$dbpass);
> $query = "SELECT code FROM templates WHERE name = 'footer'";
> $result = mysql_db_query($dbtabe,$query);
> $row = mysql_fetch_array ($result);
> echo $row[code];
> ?>
> -------------- end page ----------
> For some reason it converts the tags on the php code as it pulls it out, i
> figure echo isn't the right function to do this and echo is converting the
> '<?' to '<?'.
>
> I tried eval(), I need a function similar to include(), but can take strings
> instead of files. If the content that was in the database and I include()'d
> it, it would have the desired effect.
>
> Thanks in advanced
>
> - Kyle
>
>
-- mike cullerton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]