Is it possible to create a link that acts like a button and can carry out a function when clicked?

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-03-19T19:49:08Z Indexed on 2010/03/19 19:51 UTC
Read the original article Hit count: 120

Filed under:
|

In PHP,

I want to execute a function when a hyperlink is clicked. The only way I can think of doing this is by having the link attach a get parameter to the url when clicked and by doing an if statement that checks to see if that parameter exists and if so then have the function executed. But is there a way to do this like:

<a href='#' onclick='<?php functionName(); ?>'>

Obviously there are a million things wrong with this example but is it possible in any other way?

© Stack Overflow or respective owner

Related posts about php

Related posts about function