RE: [PHP] fortune script.
| From: | Robert Covell | Date: | Fri, 24 Nov 2000 19:14:40 +0000 |
| Subject: | RE: [PHP] fortune script. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26992@lists.php.net to get a copy of this message | ||
I do the same thing but like this:
<?
echo passthru (fortune);
?>
-Bob
-----Original Message-----
From: Kurth Bemis [mailto:kurth@usaexpress.net]
Sent: Friday, November 24, 2000 12:10 PM
To: php-general@lists.php.net
Subject: [PHP] fortune script.
i've written a quick script to call the program /usr/games/fortune and
display the result on a page....the code that i'm using is below....
<?php
$runext = exec("/usr/games/fortune -s", $output, $error);
list(,$run) = each($output);
print "$run\n";
?>
the only problem i have is that if a fortune is picked that has two lines
it drops the second line. any ideas?
see it in action at http://www.usaexpress.net/fortune.php
~kurth
Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
Passwords are like underwear. You don't share them, you don't hang them on
your monitor, or under your keyboard, you don't email them, or put them on
a web site, and you must change them very often. --Seen in sig.
kurth@usaexpress.net | http://www.usaexpress.net/kurth
PGP key available - http://www.usaexpress.net/kurth/pgp
Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net
(http://www.distributed.net)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net