You are here: Re: Executing PHP in a variable? « PHP Programming Language « IT news, forums, messages
Re: Executing PHP in a variable?

Posted by brett on 11/11/06 22:03

> You want to use eval(), here is the entry on the on-line PHP manual (a
> great reference for PHP coding):

I still can't get this to work. There are three files involved. The
chain starts here:

LinkGuide.php --
<a href="www.abc.com/page1">Some Link</a> (abc)

somefile.php --
Here's the link from LinkGuide:
<?php $content = file_get_contents(TEMPLATEPATH . '/LinkGuide.php');
echo $content; }
?>

header.php --
Finally, here's the two files from above:
<?php
$content = file_get_contents(TEMPLATEPATH . '/somefile.php');
echo eval("$content");
?>

I get this error:
Parse error: syntax error, unexpected T_STRING in
d:\home\blog\wp-content\themes\default\header.php(111) : eval()'d code
on line 1

Any suggestions?

Thanks again,
Brett

 

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

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