You are here: Re: How to write PHP standard output on a text file? « PHP Programming Language « IT news, forums, messages
Re: How to write PHP standard output on a text file?

Posted by NC on 02/11/06 01:08

francescomoi@usa.com wrote:
>
> Using PHP 4.3.11, I want my script not to write standard output
> on the webpage, but on a textfile.
>
> I tried with:
>
> [code]
> $variableName = 44;
> system("/usr/local/php/bin/php /home/foo/script.php >
> /home/foo/file.txt", $retval);
> [/code]
>
> But '/home/foo/script.php' doesn't consider $variableName.

Of course; you are not passing it to the script... Try this:

$variableName = 44;
system("/usr/local/php/bin/php /home/foo/script.php $variableName " .
" > /home/foo/file.txt", $retval);

In the script, you'll have to refer to the variable being passed as
$argv[1].

Cheers,
NC

 

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

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