0

我有两个文件,其中一个index.php包含一个提交给 abc.php 的表单。现在的问题是有一个框架,index.php我想在其中显示提交表单后得到的数据abc.php。我试过但我不能it.Hope 我已经提到了所有需要的东西。任何建议将不胜感激。

4

1 回答 1

0

设置表单的目标(phpfiddle demo):

<?php
if(!empty($_POST['submit_to_frame']))
{
    echo htmlspecialchars($_POST['the_data']);
}
else
{
?>
<iframe id="the_frame" name="the_frame"></iframe>
<form method="POST" target="the_frame">
    <input type="hidden" name="submit_to_frame" value="true" />
    <input type="text" name="the_data"/>
    <input type="submit" value="OK">
</form>
<?php
}
?>
于 2013-01-20T20:46:09.430 回答