Rotating/Random Signature Image
5 posts
• Page 1 of 1
Rotating/Random Signature Image
I am using this now on my signature... notice the image will change randomly on reloads.
Make sure your images are in the same directory as the code snippet below (the second one). Then whatever you call it... use it in your sig like this...
- Code: Select all
<img src="http://www.yourdomain.com/directory/filename.php">
Here's the code for your server.
- Code: Select all
<?php
$folder = '';
$exts = 'jpg jpeg png gif';
$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
foreach($exts as $ext) { // for each extension check the extension
if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
$files[] = $file; // it's good
++$i;
}
}
}
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP <4>
"Greatness is not a function of circumstance. Greatness, it turns out, is largely a matter of conscious choice, and discipline." - Jim Collins
- kanaloa
- President
- Posts: 11795
- Joined: Sun Mar 10, 2002 1:18 am
- Location: HI & SC
- Real Name: John Derrick
Nice on John, here something I have always used for this sort of situation; http://automaticlabs.com/products/rotator
-Sid
-Sid
Do you want the latest news on Betas & Software, Security, or even Vista? Check out our <a href="http://www.pro-networks.org/forum/home_index.php" target="_blank" class="postlink">news areas</a> and be sure to <a href="http://www.pro-networks.org/main/newsletters.htm" target="_blank" class="postlink">subscribe to our PROneT newsletters!</a>
5 posts
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 6 guests