call a php function with onclick
Hi, I would like to know how it is possibile to call a php function inside an onclick=function (....), I try to explain me better
I have 2 php functions :
1. add_friend($me,$friend) and
2. remove_friend($me, $firend)
I would like to have 2 links in this way:
<a href="#" id="add-friend" onclick="add_friend($me,$friend)>Add Friend</a>
<a href="#" id="add-friend" onclick="remove_friend($me,$friend)>Remove Friend</a>
when I click on the first link I call the add function when I click on the other the remove
It is something similat to the twitter or pownce code, but they use button and form, I would like to use links
I have inserted the code on this page:
http://www.jabberout.com/wiki/index.php/Action_buttons
please some easy tutorial to solve it
Ciao
Stefano