printing PHP code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

printing PHP code

Post by mzfp2 »

Hi

I have a few functions which reads a template html file and fills in template variables with actual values.

However when outputting PHP code to the template file like this:

print "<? print something; ?>";

the code is not excuted in the generated HTML file,

how could i write to a document at execution time, and make the php code itself im writing execute too?

the example above best illustrates what i mean

thanks

M
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

There are security issues with running as PHP any file seen. PHP in that case would be pretty promiscous. And we all know what kinds of things that can lead to. Check out include(), recquire(), and eval().

Cheers,
BDKR
Post Reply