powerboy <po******@rarextreme.com> wrote:
: "Ankur Gupta" <ag****@cc.gatech.edu> wrote in message
: news:bi**********@solaria.cc.gatech.edu...
:> I want to creating an application where all my php(with html) is
: stored in the database.
:> So my index.php would find the appropriate the php file associated
: with the index page. It should execute this new code
:> as part of the original index.php. Can you please let me know if it
: is doable?
: Yes this is doable with
http://php.net/eval
: Why you would want to do something like that I'm not sure - a database
: would be more suited to storing the data as opposed to the code.
The idea is to have bunch of templates and associate them with a page. So for instance,
each user can have totally different looking index page based on their preferences.
So when a user is directed to a index.php page. This page would have the code
to find an appropriate template and render it.
I am still having problems with using eval function though. Here's what I am trying to do:
<?php
$var = "2344";
$phpCode = '<html><body><?php echo $var; ?> </body></html>';
echo $phpCode. "\n";
eval ("\$phpCode = \"$phpCode\";");
echo $phpCode. "\n";
?>
No output why??
Thanks,
--
-Ankur Gupta