[PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.

Thanks.

Payne

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php and Fortune

2003-10-22 Thread Mykroft Holmes IV


Chuck PUP Payne wrote:
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.
Thanks.

Payne

echo 'pre';
passthru(fortune);
echo '/pre';
Should do it. I use this for a nice little Server Status page that 
iterates through an array of unix commands, works like a charm.

Adam

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Php and Fortune

2003-10-22 Thread Marco Tabini
Hello Chuck--

You can use a number of PHP functions, such as shell_exec and passthru, 
which will run an external app and return its result either in a 
variable or directly to the output. Some more info regarding this 
specific problem (and a script) here:

http://www.phparch.com/mailinglists/msg.php?a=572205s=fortunep=g=

Cheers,

Marco

Chuck PUP Payne wrote:
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.
Thanks.

Payne

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Php and Fortune

2003-10-22 Thread Mykroft Holmes IV


Mykroft Holmes IV wrote:



Chuck PUP Payne wrote:

Hi,

Is there a way I can get php to call the program fortune then print 
that a
web page.

Thanks.

Payne

echo 'pre';
passthru(fortune);
echo '/pre';
Should do it. I use this for a nice little Server Status page that 
iterates through an array of unix commands, works like a charm.

Adam

Oops, should be:

echo 'pre';
passthru('fortune');
echo '/pre';
Adam

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Php and Fortune

2003-10-22 Thread Martin Towell
 Chuck PUP Payne wrote:
  Hi,
  
  Is there a way I can get php to call the program fortune 
 then print that a
  web page.
  
  Thanks.
  
  Payne
  
 
 echo 'pre';
 passthru(fortune);
 echo '/pre';
 
 Should do it. I use this for a nice little Server Status page that 
 iterates through an array of unix commands, works like a charm.
 
 Adam

shouldn't fortune be in backticks?
passthru(`fortune`);

Martins

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php and Fortune

2003-10-22 Thread David Otton
On Wed, 22 Oct 2003 22:54:55 -0400, you wrote:

Is there a way I can get php to call the program fortune then print that a
web page.

http://uk2.php.net/system

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Thanks Everyone. This is so cool!!! :)

On 10/22/03 11:15 PM, Mykroft Holmes IV [EMAIL PROTECTED] wrote:

 
 
 Mykroft Holmes IV wrote:
 
 
 
 Chuck PUP Payne wrote:
 
 Hi,
 
 Is there a way I can get php to call the program fortune then print
 that a
 web page.
 
 Thanks.
 
 Payne
 
 
 echo 'pre';
 passthru(fortune);
 echo '/pre';
 
 Should do it. I use this for a nice little Server Status page that
 iterates through an array of unix commands, works like a charm.
 
 Adam
 
 
 Oops, should be:
 
 echo 'pre';
 passthru('fortune');
 echo '/pre';
 
 Adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php