Updating 'Points/Score' on a number field in a database

Hi,

I have a website that contains member login in it. There is a page that contains a number of javascript/HTML code boxes in it. I want every time a member clicks in any of those boxes, they will receive a score/point of some sort; like 10 or 20. This field of Score/Points will be individual for every member and after reaching a certain number of points the members will redeem their points in return of some gifts that I will send them. Some Promo codes and stuff like that.

Is there any way to achieve this?

Thanks in Advance.

Hi,

You can use onClick() , event listener, for your boxes and the update() method to update the number of points in the relevant database for the relevant user .
Use the afterInsert() hook to check the number of points and send an email if it has reached a certain number of points.

Thanks Aleks.

I’ll try and use it. Let’s see if it works.