主页 M

js动态改变php传出的值

2014-09-13 网页编程网 网页编程网
<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";
}//if
}//func
</SCRIPT>
<html>
<head>
</head>
<body>
<a href="#" href="#" onClick="javascript:func();">Please Click</a>
</body></html>

ok.php代码如下:

<?php
if($_GET["action"]=="ok"){
echo "I'm OK!";
}else{
echo "I'm not OK!";
}
阅读原文
阅读 3625
123 显示电脑版