What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » General » General Chit Chat » Hosting Random Images!

Hosting Random Images!
Author: Message:
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
34 / Male / –
Joined: Jun 2004
RE: Hosting Random Images!
Please don't use tractors version, but us this one insted:
code:
    <?php
    $dir = "imgs";
    $dh = opendir($dir);
    $files = array();
    while (false !== ($filename = readdir($dh))) {
    $files[] = $filename;
    }
    sort($files);
    array_splice($files, 0, 2);
    srand( (double) microtime()*1000000 );
    $key = array_rand($files);
    header("location: $dir/".$files[$key]);
    ?>

The difference?
This version allows give the browsers a chance to cache the images :P
06-01-2006 06:25 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Hosting Random Images! - by .Roy on 06-01-2006 at 01:15 PM
RE: Hosting Random Images! - by M73A on 06-01-2006 at 01:15 PM
RE: Hosting Random Images! - by user27089 on 06-01-2006 at 01:19 PM
RE: Hosting Random Images! - by .Roy on 06-01-2006 at 01:32 PM
RE: Hosting Random Images! - by user27089 on 06-01-2006 at 04:11 PM
RE: Hosting Random Images! - by Plik on 06-01-2006 at 06:25 PM
RE: Hosting Random Images! - by ayjay on 06-01-2006 at 09:27 PM
RE: Hosting Random Images! - by Eljay on 06-02-2006 at 07:57 AM
RE: Hosting Random Images! - by John Anderton on 06-02-2006 at 09:10 AM
RE: Hosting Random Images! - by ayjay on 06-02-2006 at 12:57 PM
RE: Hosting Random Images! - by callmegarfield on 04-04-2007 at 02:30 PM
RE: Hosting Random Images! - by Zahid™ on 04-04-2007 at 02:42 PM
RE: RE: Hosting Random Images! - by callmegarfield on 04-04-2007 at 02:59 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On