Warning: Undefined array key "action" in /home/bakers/html/entryreply.php on line 5

Warning: Undefined variable $output in /home/bakers/html/entryreply.php on line 50

Warning: Undefined array key "EntrySubject" in /home/bakers/html/entryreply.php on line 51

Warning: Undefined variable $logintext in /home/bakers/html/entryreply.php on line 97

Warning: Undefined variable $reply_name in /home/bakers/html/entryreply.php on line 103

Warning: Undefined variable $reply_email in /home/bakers/html/entryreply.php on line 104
Perturb.org - interesting technology related things from around the internet

Random Pictures

I got a little piece of code written that will allow me to do random pictures.

// Seed the random
srand ((double) microtime() * 10000000);
// Open the text file and read in the full file
$fd = fopen ('images.txt', "r");
$text = fread($fd,filesize('images.txt'));
// Split the file at the \n into an array
$array = split ("\n", $text);
$filename = trim($array[array_rand($array,1)]);
// Close the file
fclose($fd);

So if you refresh this page you should get a random picture each time. This just means that I really need to take some more pictures. Some of the pictures that I put in there are only in there because I didn't have anything else to put in there. Maybe that's what I will do tomorrow. I just need to figure out what to take pictures of.


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.239.50.33
To prevent spam please submit by clicking the kitten: