Skip to content Skip to sidebar Skip to footer

How To Execute Php Function On Html Button Click

Hello I want to execute bb() function on button click. I tried following code but it did not work. echo '
'; echo '

bb2.php : contains function that returns "hello".

<?phpfunctionbb()
{
echo"hello";  // VALUE RETURNED.
}

bb();

?>

Create two text files with the given names, copy-paste this codes, open your browser and run "localhost/bb1.html".

This is how a button calls a PHP function : Ajax does all the magic.

Post a Comment for "How To Execute Php Function On Html Button Click"