想在child.php中的from提交数据时
farther.php中的php代码要获取child.php中的值,改怎么做到,高手帮忙farther.php<SCRIPT>
function opslogin(str1,str2,str3)
{
window.showModelessDialog(str1,window,'dialogHeight:'+str2+'px;dialogWidth:'+str3+'px;scroll:no;resizable:no;status:no;help:no');
}
</SCRIPT><input type="submit" name="Submit" value="cd1" onclick="opslogin('child.php','200','300');"/>
<?php
print_r($_POST);
?>child.php<base target="_self">
<form action="farther.php" method="post">
<input name="" type="text"><input name="提交" type="submit" value="提交">
</form>

解决方案 »

  1.   

    farther.php <SCRIPT> 
    function opslogin(str1,str2,str3) 

    window.showModelessDialog(str1,window,'dialogHeight:'+str2+'px;dialogWidth:'+str3+'px;scroll:no;resizable:no;status:no;help:no'); 
    } function fnUpdate(s)
    {
    document.getELementById("myname").value = s;
    }
    </SCRIPT> 
    <input id="myname">
    <input type="submit" name="Submit" value="cd1" onclick="opslogin('child.php','200','300');"/> 
    <?php 
    print_r($_POST); 
    ?> child.php 
    <script>
    function fchange()
    {
      var sData = dialogArguments;
      sData.fnUpdate(document.getElementById("mytest").value);
    }
    </script>
    <base target="_self"> 
    <form action="farther.php" method="post"> 
    <input name="mytest" id="mytest" type="text" onchange="fchange()"> <input name="提交" type="submit" value="提交"> 
    </form>
      

  2.   

    更正:
    farther.php <SCRIPT> 
    function opslogin(str1,str2,str3) 

    showModelessDialog(str1,window,'dialogHeight:'+str2+'px;dialogWidth:'+str3+'px;scroll:no;resizable:no;status:no;help:no'); 
    } function fnUpdate(s)
    {
    document.getElementById("myname").value = s;
    }
    </SCRIPT> 
    <input id="myname">
    <input type="submit" name="Submit" value="cd1" onclick="opslogin('js.html','200','300');"/> 
    <?php 
    print_r($_POST); 
    ?> 
    child.php 
    --------------------
    <script>
    function fchange()
    {
      var sData = dialogArguments;
      sData.fnUpdate(document.getElementById("mytest").value);
    }
    </script>
    <base target="_self"> 
    <form action="farther.php" method="post"> 
    <input name="mytest" id="mytest" type="text" onchange="fchange()"> <input name="提交" type="submit" value="提交"> 
    </form>
      

  3.   

    楼主可以查下showModelessDialog用法
    window.dialogArguments从母页面中得到值。
    window.returnValue把子页面的值传回母页面。
    father.php
    var s=window.showModelessDialog(str1,window,'dialogHeight:'+str2+'px;dzable:no
    document.getElementById("myname").value = s; 
    child.phpwindow.returnValue=document.getElementById("mytest").value;