You are here: Re: How to echo content of a file? « PHP Language « IT news, forums, messages
Re: How to echo content of a file?

Posted by Colin McKinnon on 09/29/41 11:25

talthen.z-serwera.o2@nospam.pl wrote:

> "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com>
>
>> ob_start();
>> include('file');
>> $x = ob_get_clean();
>> echo $x;
>
> Well.. it doesn't work. I changed it to:
> <?
> $hej=5;
> ob_start();
> include('file');
> $x = ob_get_clean();
> ob_end_clean();
> echo $x;
> ?>
>
> But still it shows me non parsed "file".
>

If you REALLY can't change the included file to use proper PHP syntax, you
could try using eval() but I suspect you really just need to add <?= ?>
tags around the PHP variable. Make sure you understand the security
implications before using eval() on a production machine, - you're leaving
your system wide open to PHP injection. Even if you just fix the tags, your
going to be vulnerable to XSS attacks.

C.

 

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

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