I hope the first one is crystal clear, may be I should clarify the second. You may well ask if it isn't. The second quoted is, you have DB full of all image path and you load index in PHP session. then you use that index in generating index dynamically using img tag. you keep the page reloading throughout the session (use cookie?). Each time page reloads it changes index and hence the image.

dirty and unprofessional but it works. It is poor alternative to AJAX :ban:

I have done that in most of the site I have developed. I am not sure why there seem to be a beef with AJAX but for me it seems like the best alternative to using Flash.

I know JavaScript enough to be able to develop almost all that I want to, but there is one issue with doing it from scratch, you spend too much time trying to get it to work on all browsers. And also from experience I think if you are a beginner AJAX is easy to learn as compare to plain JavaScript.

So my recommendation is try AJAX, and a step further I would say look at jQuery or Mootools.

Ajax is a group of interrelated web development methods used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not needed, and the requests need not be asynchronous.

It is a good idea to learn the basics of JavaScript before diving into AJAX. If you start using the AJAX Frameworks, such as jQuery, SWFObject,jQuery UI, Prototype, YUI, you really need to know basics of JavaScript. I started teaching my wife AJAX using jQuery, she can do most things using jQuery, but she does not know JavaScript.