You are here: Re: executing PHP code from db? « All PHP « IT news, forums, messages
Re: executing PHP code from db?

Posted by Peter Wilson on 06/20/05 00:33

>> very nice but how do you get it to parse the code? there for executing
>> say the echo?
>
><?php
>$var = "world";
>$string = "<html><etc> hello <?php echo $var; ?> --more stuff";
>eval('?>' . $string . '<?php ');
> ?>
>
>interestingly, if you swap lines 2 and 3, it wont work. That is, $var
>will be an empty string.
when I tried this pulling data from a table like this

<?php eval('?>' . $row_menutext['text'] . '<?php '); ?>

all I got was the <?php echo 'hello';?> put on the page not hello
echoed?

Peter
Motto "A smile aday keeps the blues away"

http://www.sci-comm.clara.net/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация