This does’nt seem like it would be difficult but i can’t figure it out how to do it.
I want to store standard html AND php code into a database field and echo it onto an index page. Here is an example of what I am trying to accomplish:
[code=php]
<?php
$result = mysql_query(“SELECT page_content FROM pages WHERE id =1”);
$page_info = mysql_fetch_assoc($result);
?>
<html>
<head></head>
<body><?php echo $page_info[‘page_content’];?></body>
</html>
Note: this is a very basic version of what i am trying to to! ?
and the database field would hold HTML and PHP.
[code=php]
in database field:
………………………………………………………
<p>there is some html page content</p>
<p>look at the calendar</p>
$cal = new Calendar();
echo $cal->generate_calendar();
………………………………………………………
i have tried eval but it seems to only work with php code and not a mixture of both.
I would appreciate any help you can give!
Thanks,
Nate