In javascript create a simple program that calls a php scrip

In javascript create a simple program that calls a php script. Create this php script to connect to a dummy database on a local machine

Solution

Below script contains php script, which when executed, displays a button.. Click the button to display the hello message..

<html>

<body>

<script type=\"text/javascript\">

function on_callphp()

{

var result=\"<?php php_func();?>\";

alert(result);

return false;

}

</script>

<form action=\"\" method=:POST\">

<input type=\"button\" value=\"Hit me\" onclick=\"on_callphp()\"/>

</form>

<?php>

function php_func()

{

echo \"Hello\";

}

?>

</body>

</html>

In javascript create a simple program that calls a php script. Create this php script to connect to a dummy database on a local machineSolutionBelow script cont

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site