Reply to Re: [PHP] ob_start changed from php4 to php5?

Your name:

Reply:


Posted by Rory Browne on 08/17/05 21:18

This doesn't help with your ob problem, but if you simply want to
capture the output of the system cmd, then you can use $output =
shell_exec($command) instead of system() IIRC.

On 8/17/05, Marten Lehmann <lehmann@cnm.de> wrote:
> Hello,
>
> I have a function catching the output of a script:
>
> function encodeDomain ($domain) {
> ob_start();
> system("echo '$domain'");
> $output = ob_get_contents();
> ob_end_clean();
> }
>
> And I have a php-script using this function:
>
> <?
>
> encodeDomain($domain);
> header("Location: http://www.php.net");
>
> ?>
>
> While this worked fine in PHP4, with PHP5.0.4 I always get the following
> error:
>
> Warning: Cannot modify header information - headers already sent in
> test.php on line 4
>
> The redirect works if I don't use the encodeDomain() function. Does the
> system-output affect the php-outout status in any way? I checked the raw
> http-output and I can see nothing of the output from the system()-call.
> Does maybe PHP simply say "output has been send" although it hasn't been
> send actually?
>
> Regards
> Marten
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original 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

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