Home  >  Article  >  Backend Development  >  急php传值有关问题

急php传值有关问题

WBOY
WBOYOriginal
2016-06-13 13:28:21806browse

急急急!php传值问题
部分代码:foreach($titlere as $valre){ ?>


  =$valre[swap_title]?>

 
同页面内获取鼠标点击后的=$valre[id]?>的值,(目的是做再次的查询并输出结果)。

------解决方案--------------------
用js比较简单:
JScript code

var abc=null;
function record2(param){
  //将当前参数赋给全局变量abc,那么在此函数内外都可调用
  abc = param;
  
  //或者在当前函数跳转时加参数,那么后端用GET接收
  location.href="xxx.php?an="+param;
}

#第二种情况的GET接收页面
if(isset($_GET['an'])){
    print_r($_GET['an']);
} <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn