Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-07-2013, 07:32 AM   PM User | #1
Jian0203
New Coder

 
Join Date: Mar 2012
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Jian0203 is an unknown quantity at this point
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
Jian0203 is offline   Reply With Quote
Old 01-07-2013, 11:01 AM   PM User | #2
niralsoni
Regular Coder

 
Join Date: Mar 2008
Location: London
Posts: 129
Thanks: 1
Thanked 31 Times in 31 Posts
niralsoni is an unknown quantity at this point
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
niralsoni is offline   Reply With Quote
Old 01-07-2013, 11:19 AM   PM User | #3
Shane Mark
New to the CF scene

 
Join Date: Mar 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Shane Mark is an unknown quantity at this point
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.
Shane Mark is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:01 PM.


Advertisement
Log in to turn off these ads.