I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing the page.
I found this code (i didn't write it) which works to load images but does not switch them with timing. Can someone help me so that it will rotate a new image from the folder every 8 seconds?
<?php
/*
By Matt Mullenweg > http://photomatt.net
Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
Latest version always at:
http://photomatt.net/scripts/randomimage
*/// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder = '';
// Space seperated list of extensions, you probably won't have to change this.
$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.2
$rand = mt_rand(0, $i); // $i was incremented as we went along
header('Location: '.$folder.$files[$rand]); // Voila!
?>
What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is going wrong. It's a set of filters for events. The filter marked "type" (category) works
Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly. Any help would be great. Thanks.Code: // IF NO errors process form if ($error == "")
Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if i need to use the "create databse" and create "user identified by ''" for each
Legal Issues for SAP ERP o ERP in general
Hi experts,
How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:Code: <?php$mydate = "";$daysaway = 400;$startdate = "5/5/2005";//I need
using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the button and it puts the name into the database and into a list on my page. it works fine. Now, I wanted to
SAP Logon Failed
I tried to login to SAP through MMC.
Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylife/public_html/index.php:29) in /home/praylife/public_html/index.php on line 188Warning: Cannot
Calling a Procedure with IN & OUT Parameters
Hello,
$action = "insert"; //$action = $_GET['action'];
$action = "insert";//$action = $_GET['action'];why is this invalid type? I am just modifying code that is there and want the action = insert so it will run all the parts of the code for