点击一次鼠标,打开一个提示窗口,同时隐含传参数给另一个程序(不再打开窗口)

main.php
这是主窗口

1<input onclick="test()" type="button" value="test"/>
1<script>   
2function test() {   
3open("test_pop.php"); // 弹出窗口   
4var im = new Image();   
5im.src = "test.php?v=abc"; // 传递信息   
6}   
7</script>

test_pop.php
显示通过im.src = "test.php?v=abc"; 传递的信息

1   
2$filename = "test.txt";   
3while(! file_exists($filename)) ;   
4$ar = unserialize(join("",file($filename)));   
5print_r($ar);   

test.php
接受信息并保存于文件

Published At
Categories with Web编程
Tagged with
comments powered by Disqus