CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   Image onlick to show next image (http://www.codingforums.com/showthread.php?t=285392)

Jian0203 01-07-2013 07:32 AM

Image onlick to show next image
 
Hi, i want to implement a function which the user will click on an image, the image will then change to the next image. On the background, the system also record down how many click(s) have been clicked on the image.

But i am going to run this javascript function on php. That means the picture will be retrieve from database. Is it possible for me to do so ?

I tried to look for some tutorial for image onclick event online. However, they only retrieve the data from client side. May i know is it okay to retrieve the image from server side by javascript ?

Thanks for helping :)
I appreciate your effort a lots :thumbsup:

niralsoni 01-07-2013 11:01 AM

Not sure about php (haven't worked on that)... But we used to do this using java (jsp and servlet).

The concept was -
1) set source of the image as your server file, rather then an image file. Something like -
Code:

<img src="/myserver/recordClickPage.php?param1=value1">
2) on the server, record the click counts and fetch the next image
3) the next image will be returned from the server (by writing it as binary file)

I am not sure how this will work in php. All the best !!!

Regards,
Niral Soni

Shane Mark 01-07-2013 11:19 AM

THanks
 
I would like to say thanks to all user who reply on this topic because i also get this kind of problem and after getting your solution a got my solution.


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.