Jump to content

Is this possible? PHP to read next image in directory


fusiongt

Recommended Posts

Hi I'm somewhat new to PHP. I know the basics like connecting and manipulating a MySQL database but I haven't delved too far into what PHP has to offer. I came about a problem recently that I would like to know if it is possible for PHP to solve...

So I run a fairly large web site that focuses on large image galleries. The image galleries are just basic html pages that are created from one of those programs that automatically create image galleries. I noticed the load times weren't that great as the images ranged from 75kb-300kb... My solution to this would be to add this script to load the next image in the gallery while the person views the current image.

(in the header)

<script language="javascript">
if (document.images)
{
  img1 = new Image();
  img1.src = "load_next_image.jpg";
}
</script>


The problem I am having is how would I get it so my program that creates image galleries knows to put the next image in the "load_next_image.jpg" area? My program right now doesn't have an option and I'm no programmer genius to manipulate it.

I've seen PHP do a lot of neat things and was wondering if it could some how know what the next image in the directory is... is this possible? If someone could please help it would make my day. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.