作者Kej (打面人间体验中)
看板PHP
标题Re: [请益] 如何一次传递两个数值
时间Tue May 22 21:59:12 2007
※ 引述《williamslee (非常新的新手)》之铭言:
: 小弟我目前在作一个网站 遇到了一个问题
: 假设有3个页面
: a页面为网站的menu 放在左侧 有许多选项可选
: b页面为网站主页 右上方
: c页面为网站主页 右下方
: 现在想利用a页面的一个link 将参数($id = XXX)同时传给b和c页面并换页
: 不知道该怎麽作
: html的超连结也只能一次换一个页面
: ( <a herf = b.htm?id = XXX target = rightupframe> )
: 本想是先传给b页面後 b页面触发c页面换页
: 但是也不知道一个页面触发其他页面换页的php语法怎写(书上都是写自己触发自己)
: 请各位帮帮忙 谢谢
可以用Java Script作,先写个function:
<script type="text/javascript">
function open2frames(i,j){
var d = window.parent.document;
d.getElementsByName('rightupframe')[0].src = 'b.php?id=' + i;
d.getElementsByName('rightdownframe')[0].src = 'c.php?id=' + j;
}
</script>
然後原本超连结的地方改成:
<a href="javascript:open2frames('XXX','YYY');">
这样应该就可以了
--
...the people who are crazy enough to think
they can change the world, are the ones who do...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.133.102.122