TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-18-2008, 03:14 PM   #1 (permalink)
The Visitor
 
Join Date: Aug 2008
Posts: 3
Thanks: 0
FaceDancer is on a distinguished road
Big Grin Random Avatar Script

Hail, everyone. It's quite a primitive script for "facedancing" on forums or elsewhere:)

For this script you need several images of same format and size (it is better when they have same size), a directory to host them and the file with the script, duh:P

For this very script the images must have names 0, 1, 2, etc.

PHP Code:
<?php 

$avatars_folder 
"./avatars/";

$frmt ".jpg"

srand(time(0)); 

$rand_int rand(019); 

header('Location: ' $avatars_folder $rand_int $frmt); 

?>
Each time a different avatar will be displayed (my signature is an example).

Have fun:)
__________________
Send a message via ICQ to FaceDancer
FaceDancer is offline  
Reply With Quote
Old 08-22-2008, 05:47 AM   #2 (permalink)
The Wanderer
 
Dr_Neffy's Avatar
 
Join Date: Aug 2008
Location: italy
Posts: 7
Thanks: 0
Dr_Neffy is on a distinguished road
Default

oh yeah i know this smale trick
yo can also do
PHP Code:
<?php
$a 
= array("im1.jpg""im2.jpg""blabla.jpg");
srand(time(0));
$rand_int rand(0count($a)-1);
echo 
$a[$rand_int]."\n";
?>
so you don't need images with 1, 2, 3... numeration it's can be more usefull ;)
Send a message via MSN to Dr_Neffy
Dr_Neffy is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:00 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design