Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Rotating Avatar

  1. #1
    Poster
    Join Date
    Jun 2003
    Location
    Yet to be determined
    Posts
    993
    avatar.gif

    Code:
    <?php
    $dh = opendir(".");
    while (false !== ($file = readdir($dh)))
    {
    if (preg_match('/\.gif$/i', $file) and $file != "avatar.gif")
    {
       $filelist[] = $file;
    }
    }
    
    srand((double)microtime()*1000000);
    $picnum = rand(0, sizeof($filelist) - 1);
    
    header("Location: " . $filelist[$picnum]);
    
    closedir($dh);
    ?>
    .htaccess
    Code:
    AddType application/x-httpd-php .gif
    Now you will need to upload .gif images to the selected directory that you have placed both avatar.gif and .htaccess, once you have done so, you can link to "avatar.gif" and your avatar will refresh whenever someone refreshes their browser.

    Example:


  2. Internet, Programming and Graphics   -   #2
    h1
    Guest


    You'll also need the following headers:
    Code:
    $fn='http://www.yoururl.com/avatar.php'; // where your avatar is located
    header('Cache-control: no-cache, must-revalidate, no-store');
    header('Content-disposition: filename='.$fn);
    header('Pragma: no-store');

  3. Internet, Programming and Graphics   -   #3
    h1
    Guest
    And if you don't want to or can't use .htaccess, do this:
    Code:
    header('Content-type: image/gif'); // or image/jpeg or image/png or whatever

  4. Internet, Programming and Graphics   -   #4
    BANNED
    Join Date
    Apr 2003
    Posts
    1,143
    lol, haxor you literally wrote it oh well

  5. Internet, Programming and Graphics   -   #5
    h1
    Guest
    NightStalker seems to have disappeared.

  6. Internet, Programming and Graphics   -   #6
    BANNED
    Join Date
    Apr 2003
    Posts
    1,143
    Originally posted by haxor41789@25 March 2004 - 02:01
    NightStalker seems to have disappeared.
    lol I wonder why

    pwned! :

  7. Internet, Programming and Graphics   -   #7
    BANNED
    Join Date
    Apr 2003
    Posts
    1,143
    Nightstalker, i'm sorry to say you have been:



  8. Internet, Programming and Graphics   -   #8
    Poster
    Join Date
    Jun 2003
    Location
    Yet to be determined
    Posts
    993


    It works with or without that.

  9. Internet, Programming and Graphics   -   #9
    h1
    Guest
    Actually, I was getting the same image... now I'm getting "user posted image."

    [Edit] It appears KDP is down... again...

  10. Internet, Programming and Graphics   -   #10
    Poster
    Join Date
    Jun 2003
    Location
    Yet to be determined
    Posts
    993
    The avatar, and KDP is working fine here...

    <edit> Haxor, have you been on the crack again?

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •