Hi, i have i site where you can get points when you click on an image.
I need to have a code that automatically gives points to the user that clicks on the image.
this is the mysql query to give the points.

mysql_query("UPDATE members SET points = '$points1' WHERE username= '$username1'")
(this is wrong i know)

and then like <img src"blabla" 'Onclick: give points :D' >

is there any script that can do this

Hi,
The ideea is to use Ajax. Create a JavaScript function, for example ajaxSend() that accesses a php file in which you have the code for update. Then, add an onclick="ajaxSend()" in the image.
See on the net tutorials about Ajax, or jQuery ajax.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.