0

Hi,

function xyz()
{
<a href="<?=$rame['img_link']; ?>"  ><img src="img/<?=$rame['preview']; ?>" width="<?=$w;?>" height="<?=$h;?>" alt="<?=$rame['name']; ?>" /></a>
}

Using function I get image and url
suppose image->url=http://www.daniweb.com

I want to do like...
when user click on this image i want to save count(hit) into database(mysql)

How to do this...??

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by nav33n
0

In the script (the url), check if the user is a unique user (by checking his IP address). If he is a unique user, update count. :-/ You can't call a javascript event (onclick) to update the table. You can try the same with Ajax though.
ie., Onclick, call the ajax function, check the user's IP and then update the table if he is a unique user.

0

Hi nav33n,

Can you give me sample example how to do this using Ajax??

0

Sorry! I don't have a sample example. But this example is the closest I could find.
http://www.w3schools.com/php/php_ajax_suggest.asp
In the example, onkeyup event is used, which calls the ajax function whenever a key is pressed (and give suggestions). Instead, you can have onclick event, which will call the ajax function, which checks the user's IP and update the count.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.