js 调用php代码

<?php  
$test = "var a = ".$_GET['test'].";";  
?>  
<mce:script type="text/javascript"><!--  
<?php  
    echo $test;  
?>  
alert(a);//这里就可以把a取出来了。而且a的值是来源于用户的GET请求  
// --></mce:script>  

 

posted @ 2014-12-12 17:11  马辉  阅读(944)  评论(0编辑  收藏  举报