|
-
Mar 23rd, 2003, 08:12 AM
#1
Thread Starter
Fanatic Member
URGENT !! PHP script needed to preload ALL images in a given folder...
Anyone that can solve this needs a medal!!!
I have a standard Java-style image preloader running at the moment... but it's hardly ideal.
It just has an array where you manually add each image you want to preload. It takes too long to do, so is there a PHP/CGI script which AUTOMATICALLY preload's all the images in a certain folder?
So instead of... "images/1.jpg","images/2.jpg...etc"
I could... "images/*.jpg"
Thank you in advance.
Regards,
Paul.
-
Mar 24th, 2003, 03:20 PM
#2
Frenzied Member
no, php is serverside so it can't preload. you have javascript preloading and that is all you can do.
harldy ideal, that is the only choice you have.
-
Mar 24th, 2003, 07:00 PM
#3
Stuck in the 80s
What you can do is create a script to read all files in the directory and output the javascript code.
This is off the top of my head:
Code:
<?php
if ($handle = opendir('/home/your_site/images')) {
while (false !== ($file = readdir($handle))) {
if (!strstr($file, ".jpg") === false) {
echo "JavaScript stuff with file name here.";
}
}
closedir($handle);
}
?>
That's the best I could come up with off the top of my head. See the manual if you need more help.
-
Mar 25th, 2003, 04:54 AM
#4
Thread Starter
Fanatic Member
We have a genius....
Thanks M8.... i'll see if I can get that working. I'll let you know.
Regards,
Paul.
-
Mar 25th, 2003, 09:37 PM
#5
Stuck in the 80s
Let me know if you need anymore help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|