Re: Storing script in database??
| From: | Justin French | Date: | Thu, 01 Aug 2002 11:10:09 +0000 |
| Subject: | Re: Storing script in database?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110652@lists.php.net to get a copy of this message | ||
I'm pretty sure you can use eval() on a string, but tread with caution, and
try to look around for security concerns.
I certainly wouldn't eval() anything supplied by a user... no way.
Justin French
on 01/08/02 7:53 PM, David Pratt (dave.pratt@webcoursesnow.com) wrote:
> I am creating an application where it would be useful to write and store
> script in a field in a MySQL database and create a loop to process the array
> of the code contained in the field. Conceptually, I think it sounds
> reasonable but I am uncertain of what kind of process I could use to have
> the code in the field variable read properly within the loop. Somewhat
> analogous to an include in HTML.
> The file would be read as though a single script file though the included
> material has come from a text field.
>
> This would be really useful for me since the code could be modified in the
> database outside a smaller application without changing the files. Any
> ideas here on how I might do this from anyone that has attempted anything
> similar? I have set everything up but just can't figure out how to bring
> the script text in the field into the file properly. Help much appreciated.
> --
>
> Dave Pratt
> dave.pratt@webcoursesnow.com
>