Hi all,
I have a webpage whick displays an image on main section. I want to add a link next to that image, that when clicked on will change the current image. i.e. select the next image in database.
How do I do this without going to a different page??
Thanks.
It's not something you can do with PHP alone, as you should know by now. The method du jour for doing such a thing would be to use Ajax. In any event, you'll need to do some client-side coding.
Moving to Client-Side Technologies Forum....
Depending on the number of images involved, you might want to do this ALL clientside and forget about images being held in a database. However if there's lots of em and the DB is a must, then AJAX is the way to go, or use an iframe.
Yes just to confirm its all about the AJAX!
Not necessarily. It can be just as easy as javascript:
imgID.src="new/path/to/sourceimg.jpg";
Not exactly AJAX, but will "change" the image without a page refresh.