I am trying to figure out a way to do some web site tracking for a business. Is there a way to add PHP code to a clickable link on a web page so that when a user clicks on a link that will take them to a different page, the PHP code is executed right before the click action is taken?
So something like this would execute some PHP code before linking to the web site?
Stackoverflow link
I am trying to figure out a way to do some web site tracking
Share
Link to a PHP function, run your code, last line of the function would be a header line.
header(Location: ‘http://whateverlink.com’);
Really no different than submitting a PHP form