I would like something like below:
<a href="http://www.someweb.com" onclick="somePHPcode">mylink
when I click on “mylink”, I’d like to to run “somePHPcode” before redirect to “someweb.com”.
Also “somePHPcode” is a PHP function calling or some PHP commands that runs, when mylink is clicked.
I do not like to use href="javascript:void(0);" or href="#" onclick="javascript..."
Because I need, “someweb.com” link to be viewd.
PHP is server side code. The onClick event happens on the browser (client side), so you can’t do this. You have to use Javascript on the client side (with maybe an Ajax call to the server who can run PHP code).