Hello Reader's, If you want to run PHP code when user click any selected anchor tag then you can use the Jquery for this. Lets see how you can run this code.
First you have to write the onlclick action on the anchor tag like this:-
<a href="#" onclick="RunningPHP();">Click Me!</a>
Now call this function in the script and code will go like this:-
<script type="text/javascript">
function RunningPHP() {
$.get("yournextpage.php");
return false;
}
</script>
Now onlick action will run the Jquery code in background. In this background process you can hit your PHP code which is in another page, like yournextpage.php.
And don't forget to call the Jquery code in the head section by :-
<script type="text/javascript" src="jquery.min.js"></script>
0 Comment(s)