Mukhila, you seem a little confused with Javascript and PHP. Javascript is run on the browser, it handles the onclick() stuff, but PHP is run on the server, (usually) before anything gets sent to the browser. It typically works like this:
User requests a page on a site by typing in a URL or clicking a link
Users browser makes a request to the web server
Web server receives request and if it is for a PHP script, it handles it to the PHP parser
The PHP parser goes through the script on the server and executes it, sending any output to the web server (Apache, nginx or IIS for example)
The web server sends the last of the output back to the users browser
The connection is terminated
That means that in order for your click handlers to be doing something, they either need to work with stuff that exists on the page already (i.e. information in a hidden div tag) or make a new request to the server (i.e. AJAX request)