Hi,
I think this involves a lot more JavaScript help than PHP, but I can't seem to find a decent JavaScript forum and I know a lot of you are javascript guru's.
Basically, I'm allowing people to upload graphics to my web site. When they upload graphics, a table in the mySQL database is updated to include information about the picture. The picture is also given a number (the number is auto-incremented). The picture can also either be gif or jpg.
So, for example, after 6 people have uploaded pictures, here's what I might have saved on my server:
0.gif
1.gif
2.jpg
3.gif
4.jpg
5.jpg
6.jpg
Good so far? Now here's the trick.. On one of my pages, you can review the graphics that are on the server. Each picture is shown one at a time, with graphical arrows to each side
<< | picture | >>
like that, sort of. Now, without reloading any part of the page each time, I need to change that picture to the next one in the series. JavaScript, would be, of course, the obvious choice here because it doesn't have to refresh the page. But, the JavaScript is going to have to know whether the picture is 0.gif or 0.jpg without referring to the database, so it can show the one that's correct. Is there a way, with JavaScript, that I can test to see if an image (like 0.gif) exists, and if it doesn't, use the other extension?
Thanks a lot,
Joseph