Preload/Cache image with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Preload/Cache image with PHP

Post by Luke »

Is there are way to use PHP instead of javascript to preload/cache images for rollovers and that sort of thing?
printf
Forum Contributor
Posts: 173
Joined: Wed Jan 12, 2005 5:24 pm

Post by printf »

No, only client side scripting can fetch data and store it on your computer in the browsers cache!

pif!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:oops: oh... thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

well.. there are a few tricks that don't require Javascript.. but they don't need PHP either. Just some clever HTML and CSS can do it.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

feyd wrote:well.. there are a few tricks that don't require Javascript.. but they don't need PHP either. Just some clever HTML and CSS can do it.
Really? Do you think you could point me in the right direction?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Code: Select all

<img src="whatever.jpg" style="display:none" alt="whatever" />
won't be displayed but will load the image. so you can use whatever.jpg later without load.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Really? Do you think you could point me in the right direction?
http://www.alistapart.com/articles/sprites
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Weirdan wrote:
Really? Do you think you could point me in the right direction?
http://www.alistapart.com/articles/sprites
That's exremely cool. Thanks!
Post Reply