Not too simple, i hope
| From: | Kyle Smith | Date: | Mon, 13 Aug 2001 02:15:40 +0000 |
| Subject: | Not too simple, i hope | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62323@lists.php.net to get a copy of this message | ||
ok ive managed to get a random line script to work now, (please dont hurt me) im asking for a little
help!
This is the script im using
<?php
randomline("poop.txt");
function randomline($filename) {
$file = file($filename);
srand((double)microtime()*1000000);
while ($randomquote == "") {
$randomquote = ereg_replace("\n","",$file[rand(0,count($file))]);
}
echo $randomquote;
}
?>
And poop.txt looks like
Random quote "umm, stuff!"
Random quote "smelly pants"
can someone please show me how to make a form which can write to this text file.... please!
-lk6-
http://www.StupeedStudios.f2s.com
Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan@hotmail.com
AIM: legokiller666