Forum Moderators: coopster

Message Too Old, No Replies

php, javascript, html for image change

image change on the same page

         

ksugam

12:08 am on May 7, 2008 (gmt 0)

10+ Year Member



Hello All,
Say i have to design a page which displays just an image (e.g. test_0108.png). this page will have 2 hyperlinks on the top, namely, "Previous" and "Next".

The current image being displayed is test_0108.png (where 01-Jan, 08-2008). Now when the user clicks on NEXT, the current image should be replaced by test_0208.png.

So basically, when the user clicks on NEXT, the next month image should appear and when the user clicks on PREV, previous month's image should appear.

I would prefer to do this in PHP. This means the page needs to be reloaded instead of replacing the image on the go.

Please help me with this!

Thanks!

bubbasheeko

2:49 am on May 7, 2008 (gmt 0)

10+ Year Member



hey ksugam!

Are you calling the file names from a database, how would the PHP know the list of files?

ksugam

6:51 am on May 7, 2008 (gmt 0)

10+ Year Member



Its just images with the naming convention test_mmyy.png format stored in the images folder.

So wht i can do is:

<img src="test_<? echo $array[i] ?>.png></img>

That part is easy.

I just wanted the functionality for the next and previous button. I am almost there with the solution but somehow, its not 100% complete.Hence needed a helping hand from someone.

Hope this helps.