I want to call a PHP function when someone clicks an html link. I don't know how to do it. Please help.
<a href="" onclick="sendcode()">Didn't get a code?</a>
<?php
function sendCode(){
//code
}
?>
I want to call a PHP function when someone clicks an html link. I don't know how to do it. Please help.
<a href="" onclick="sendcode()">Didn't get a code?</a>
<?php
function sendCode(){
//code
}
?>
Do it like this:
<a href="?sendcode=true">Didn't get a code?</a>
<?php
if(isset($_GET['sendcode'])){
sendCode();
}
function sendCode(){
//code
}
?>