read content of file type php from a table in mysql -


i created table in database named file

create table `file` (      `name` varchar(255) not null,     `type` varchar(255) null,     `content` varchar(255) null,     primary key (`name`)  )engine=myisam; 

but want when record of specific file type, open content of file

for example:

name: test type: php content:<?php echo "hello world" ?>

and append hello world in page

thanks :)

assuming understand question correctly , want run whatever code php content has: can using 2 methods, i wouldn't recommend either:

1) use eval(). simple solution bad idea, , won't work on many shared servers.

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

2) write content field actual php file (if it's not in file already) , contents of file using file_get_contents() or similar. need put url of file output, , won't work on shared servers.

http://il1.php.net/manual/en/function.file-get-contents.php


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -