Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1

    Default [PHP GD] make your own dynamic Avatar =D

    this is the actual "image"
    Code:
    <?php 
    // the header saying that it's a php script :)
    @header ('application/x-httpd-php');
    // Name of your image directory 
    $mydir = "images"; 
    
    // Make true random 
    srand( time() ); 
    
    // Open image directory and put images in an array 
    if ($dir = @opendir($mydir)) { 
     ? while (($file = readdir($dir)) !== false) { 
       if ( eregi( '.(jpg&#124;gif)$', $file ) ) { $files[] = $file; } 
     ? } 
     ? closedir($dir); 
    } 
    
    // Find a random image 
    $file = $files[rand() % sizeof( $files )]; 
    
    // Send headers for the random image 
    if ( eregi( '.jpg$', $file ) ) { 
     ? header( "Content-Type: image/jpeg" ); 
    } else { 
     ? header( "Content-Type: image/gif" ); 
    } 
    header( "Content-Length: " . filesize( $mydir."/".$file ) ); 
    readfile( $mydir."/".$file ); 
    ?>
    save this as image.php in a separte folder. (folder tree at the bottom)

    Folder tree(names without extentions are folders):
    Code:
    *-root
    &#124;
    *----avatar
        ? ?&#124;
        ? ?*----image.php (main image file)
        ? ?&#124;
        ? ?*----images (store the images of your choise here (.jpg and .gif)
    how to:
    to make it work on a forum;
    the link must be similar to: http://www.yourdomain.com/avatar/image.php/image.gif (/image.gif to fool the forum, to belive that is a image and not a php script xD)

    simple demo:
    http://www.thor.p4h.biz/avatar/images.php/image.gif (for a forum)
    http://www.thor.p4h.biz/avatar/images.php (dosen't work on a forum, but displayes the image )


    if you don't manage to make it work, post here

    note: the one i use is the same code (some tweaks that makes it more secure)

  2. #2
    Join Date
    May 2006
    Location
    Eta Carinae
    Posts
    19,505
    Blog Entries
    7

    Default [PHP GD] make your own dynamic Avatar =D

    lmao wow, thats pretty cool lol, i like the first demo pic, lol i never made one like that, pretty cool, nice
    Do not PM me regarding your problems or suggestions for the board unless you are offering me money. I will Ignore your posts and if you bother me too much, you will be banned.

    ►Easy Programming | My Youtube
    ►Naztronomy :: Astrophotography | Custom Computers




  3. #3

    Default Re: [PHP GD] make your own dynamic Avatar =D

    lmao wow, thats pretty cool lol, i like the first demo pic, lol i never made one like that, pretty cool, nice ?
    if you refresh them, you will get a new pic <.<

  4. #4
    Join Date
    May 2006
    Location
    Eta Carinae
    Posts
    19,505
    Blog Entries
    7

    Default [PHP GD] make your own dynamic Avatar =D

    yea i just noticed that, its awesome lol, i gotta learn how to do that later lol, nice
    Do not PM me regarding your problems or suggestions for the board unless you are offering me money. I will Ignore your posts and if you bother me too much, you will be banned.

    ►Easy Programming | My Youtube
    ►Naztronomy :: Astrophotography | Custom Computers




  5. Default [PHP GD] make your own dynamic Avatar =D

    lol coding is so fun, i gotta get into this thing lol, im working on making websites but php thing looks way more fun lol




  6. #6

    Default Re: [PHP GD] make your own dynamic Avatar =D

    lol coding is so fun, i gotta get into this thing lol, im working on making websites but php thing looks way more fun lol
    php is fun ^^ but you need to learn alot, i recon starting with HTML, JS and pascal (pascal can be Delphi too pascal is a programming language but it share many similaritys with php )

    btw if you want to try out some php:
    http://yurx.com/showthread.php?p=9765 i posted a werry simple php code :P

  7. #7
    Join Date
    May 2006
    Location
    Eta Carinae
    Posts
    19,505
    Blog Entries
    7

    Default Re: [PHP GD] make your own dynamic Avatar =D

    hey thor u think u can make a php script that rotates banners randomly? and another question. on a .php file, in the coding, whats the command to include a file in with the script ? like another .php file, thanks in adv
    Do not PM me regarding your problems or suggestions for the board unless you are offering me money. I will Ignore your posts and if you bother me too much, you will be banned.

    ►Easy Programming | My Youtube
    ►Naztronomy :: Astrophotography | Custom Computers




  8. #8

    Default Re: [PHP GD] make your own dynamic Avatar =D

    once i have over 8 images in the folder its often seems to refer page not found but why?

  9. #9

    Default Re: [PHP GD] make your own dynamic Avatar =D

    Quote Originally Posted by LiNuX
    hey thor u think u can make a php script that rotates banners randomly? and another question. on a .php file, in the coding, whats the command to include a file in with the script ? like another .php file, thanks in adv
    include
    if the file is going to be included into another file do include_once on all includes

    @ mooki: no idea, never seen it, my current avatar got 22 pics

  10. Default Re: [PHP GD] make your own dynamic Avatar =D

    Lol. Nice. Thanks Thor...I gotta try this out one day .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need an Avatar?
    By GF Eric in forum Questions & Suggestions
    Replies: 11
    Last Post: 09-29-2007, 08:56 PM
  2. avatar request- 200 gfp
    By cwbolton in forum Graphics
    Replies: 8
    Last Post: 09-25-2007, 02:01 AM
  3. EA & The Weather Channel..."Dynamic Gaming"
    By Scott in forum General Gaming
    Replies: 1
    Last Post: 08-14-2007, 03:53 PM
  4. Free Dynamic Avatar
    By Thor Erik in forum General Computer Talk
    Replies: 2
    Last Post: 09-13-2006, 06:51 PM
  5. [m]: Free Dynamic Avatar
    By LiNuX in forum Websites & Advertising
    Replies: 0
    Last Post: 09-13-2006, 06:09 AM

Posting Permissions

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

» Site Navigation

» Log in

User Name:

Password:

» Recent Threads

The I jUst Beat A Game...
04-11-2014 10:11 AM
Last Post By paecmaker
Today 05:09 AM
Subb
Yesterday 09:39 PM
by Jaykub
Last Post By Kenoi
Yesterday 11:37 PM
Last Movie You Saw
12-20-2013 08:13 AM
by Mizel
Last Post By paecmaker
Yesterday 03:14 PM
What are you listening...
12-27-2006 12:10 AM
by souljaa
Last Post By EpsilonX
Yesterday 01:29 PM
My first PENTA
04-17-2014 04:17 PM
Last Post By paecmaker
04-18-2014 02:27 AM
The daily pit stop
04-09-2014 09:00 PM
Last Post By paecmaker
04-17-2014 04:25 PM
Have you ever talked to...
04-16-2014 11:03 PM
Last Post By paecmaker
04-17-2014 01:47 AM