ID:185897
 
I was just wondering if anyone could help me with my PHP problem -

I have CMS that draws all information from a database based upon a field title 'strmenutitle' and a content field called 'txtcontent'. Now say I have a PHP statement stored in the txtcontent field and I want it to execute when it is displayed. How would I go about getting th ePHP to execute? All I get at the moment is a blank space.

It works by using a $_GET var of the title for the menu (whihc is amended to the page URL when you click on a link). The var is used in a query to a db to get the content relating to the menu title. Hopefully that will help.

I suppose effectivley I want to know how to execute a PHP statement that is in a string.

echo $row['txtcontent'];
This is how it is currently printed to screen

intmenunum strmenutitle intloginreq txtcontent
30 Title 0

This is how the dataabsae entry looks.


Any help will be greatly appreciated.

- GunRunner
The eval() function seems to be what you're looking for. http://us2.php.net/manual/en/function.eval.php
In response to Crispy
Right on the spot. Thanks a bunch Crispy.

- GunRunner