How To Run A Php Function On Click

how to run a php function on click

Solution- Onclick Function Not Working Wordpress Post
Hey guys fairly new to PHP as is, I need to run a PHP function call through an onClick which through my research I have found that I need to use AJAX.... Ok, so my code is meant to be pulled from the function using the jquery code below, but it isn't pulling the code and I can't see why not. My pages code