fortune script.
| From: | Kurth Bemis | Date: | Fri, 24 Nov 2000 18:10:09 +0000 |
| Subject: | fortune script. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26987@lists.php.net to get a copy of this message | ||
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)