Quantcast

Forums | MacLife

You are not logged in.

#1 2003-01-18 12:45 pm

Daniel
[dp] design#
From: Melbourne, FL
Registered: 2000-11-21
Posts: 9708
Website

Executing PHP Code Stored in a DB

Can this be done?  I know I could read the code, write it to a file, and then use the import function to execute that file, but is there any more efficient way available?  Until one of my latest projects, I've never had a need really to store the code itself in the database, but if this can be done efficiently, it will make one of my current projects a lot more robust.

Thanks,

-Dan


Airman Dan
Private Pilot, Instrument Airplane Single-Engine Land
http://homepage.mac.com/dp.design/.Pictures/atat/AtAT-Banner.jpg

Offline

 

#2 2003-01-18 2:42 pm

lostghost
Member
From: Chicago
Registered: 2001-07-08
Posts: 496

Re: Executing PHP Code Stored in a DB

You can execute any string as PHP code using the eval() function:

http://www.php.net/manual/en/function.eval.php

Offline

 

#3 2003-01-18 3:06 pm

Daniel
[dp] design#
From: Melbourne, FL
Registered: 2000-11-21
Posts: 9708
Website

Re: Executing PHP Code Stored in a DB

You can execute any string as PHP code using the eval() function:

http://www.php.net/manual/en/function.eval.php

Heh, thanks.  I found that about 5 minutes after I asked the question -- next time I think I'll RTFM before I ask the question.  big_smile


Airman Dan
Private Pilot, Instrument Airplane Single-Engine Land
http://homepage.mac.com/dp.design/.Pictures/atat/AtAT-Banner.jpg

Offline

 

Board footer

Powered by PunBB 1.2.6
© Copyright 2002–2005 Rickard Andersson