在JavaScript中调用php程序

前端之家收集整理的这篇文章主要介绍了在JavaScript中调用php程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="50234" class="copybut" id="copybut50234" onclick="doCopy('code50234')"> 代码如下:

<div class="codebody" id="code50234">
<SCRIPT Language = "JavaScript">
function func()
{
if(confirm("Are you OK with this?"))
{
this.location = "ok.PHP?action=ok";
}
else
{
this.location = "ok.PHP?action=cancel";
}
}





<a href="#" href="#" onClick="javascript:func();">Please Click



<div class="codetitle"><a style="CURSOR: pointer" data="41948" class="copybut" id="copybut41948" onclick="doCopy('code41948')"> 代码如下:
<div class="codebody" id="code41948">
<?PHP
if($_GET["action"]=="ok")
{
echo "I'm OK!";
}
else
{
echo "I'm not OK!";
}
?>

猜你在找的PHP相关文章