Executing php code within a string
| From: | Chris Hobbs | Date: | Thu, 08 Nov 2001 20:13:20 +0000 |
| Subject: | Executing php code within a string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73944@lists.php.net to get a copy of this message | ||
I've a simple content management system which allows users to use full html within their submitted items. I then output the data by pulling the info out of a db and simply echo'ing it to the browser.
Anyway, I'd like to make some php functionality available to them, so I would like them to be able to enter something like the following:
<h2> The date is <? echo date("m-d-Y")?>.</h2>
This would later be pulled out from the database and sent to the browser as:
<h2> The date is 11-08-2001.</h2>
Right now, of course, I simply echo the <? ... ?> and not the result.
Any ideas on how to process the php component before I echo it?
--
_______ ___ _ ____ _____
Chris Hobbs / ____\ \ / / | | |/ ___\| __ \
Head Geek | (___ \ \ / /| | | | (___ | | | |
WebMaster \___ \ \ \/ / | | | |\___ \| | | |
PostMaster ____) | \ / | |__| |____) | |__| |
\____/ \/ \____/ \____/|_____/
http://www.silvervalley.k12.ca.us
chobbs@silvervalley.k12.ca.us