function func() { if(confirm("Are you OK with this?")) { this.location = "ok.php?action=ok"; } else { this.location = "ok.php?action=cancel"; } } "/> function func() { if(confirm("Are you OK with this?")) { this.location = "ok.php?action=ok"; } else { this.location = "ok.php?action=cancel"; } } ">
Home >Backend Development >PHP Tutorial >PHP+Javascript calls php program in JavaScript
Copy the code The code is as follows:
< ;head>
if($_GET ["action"]=="ok")
{
echo "I'm OK!";
}
else
{
echo "I'm not OK!";
}
?>
The above has introduced PHP+Javascript to call php programs in JavaScript, including the content of PHP+Javascript. I hope it will be helpful to friends who are interested in PHP tutorials.