Php 如何在页面上使用iframe

Php 如何在页面上使用iframe,php,Php,我想单击该iframe 1中的链接以及在其他iframe中查看的内容,选择发送的消息以及在其他iframe和同一窗口中查看的已单击的messee详细信息 <iframe src="all_m.php" scrolling="yes" width="200"></iframe> <div style="float:right; margin-top:-0px; margin-right:-50px;"> <iframe src="read.php" sc

我想单击该iframe 1中的链接以及在其他iframe中查看的内容,选择发送的消息以及在其他iframe和同一窗口中查看的已单击的messee详细信息

<iframe src="all_m.php" scrolling="yes" width="200"></iframe>

<div style="float:right; margin-top:-0px; margin-right:-50px;">
<iframe src="read.php" scrolling="yes" width="200"></iframe>
</div>

您可以使用onclick=parent.func访问parrent窗口的属性,也可以通过父函数func控制其他iframe src

通常,您可以通过会话或cookie在两个iFrame之间传递数据。我可以为您提供一个解决方案,特别是对于标记单击,您可以在标记的目标属性中提供iframe名称

假设要将表单传递给其他iframe,则:

<iframe src="all_m.php" name="iframe1" scrolling="yes" width="200"></iframe>
<div style="float:right; margin-top:-0px; margin-right:-50px;">
<iframe src="read.php" name="iframe2" scrolling="yes" width="200"></iframe>
</div>
在iframe1中的表单中放置此标记:

<a href="" onclick="document.getElementById('form1').submit();" target="iframe2">link</a>