一个非常简单的页面, 上面是一个form, (text + submit), 下面是一个表格或text的列表, 点了submit, 下面的text会跟着刷新一下. 不能用js, 只能php + html实现
=== test.html ===<form action="do_sth.php" ...>
  <input type="submit" ...>
</form>...
========do_sth.php问题1: 点了submit, 页面会跳转到do_sth.php, 希望页面能留在test.html, 这个该怎么弄?
   已经有一个solution, 就是把php代码弄到test.html上, 并改名为test.php, 这个不理想, 希望有好的办法问题2: 希望点了submit后, do_sth.php的url请求变成: do_sth.php?name=...&value=..., 然后do_sth.php再_GET出参数来做下面的事情, 在哪一步做这样的request? 如何发送? header()?问题3: 页面刷新目前采用include($file)的方式, $file是共享的data文件, 不用数据库, do_sth.php更新文件, test.html来读文件, 还有好点的solution吗?多谢了~

解决方案 »

  1.   

    前面说了, 只能html + php
    连嵌入js也不能用
      

  2.   

    不能用js
    iframe的话,怎么刷新iframe的页面呢?
      

  3.   

    <form action="test.php" method="post" target="itest">
    ...............
    </form>
    <iframe src="test.php" name="itest">
    ...........
    </iframe>
      

  4.   

    html + php 
    连嵌入js也不能用    为什么不用
      

  5.   

    我胡乱写了点不知道能不能解决LZ问题
    我菜鸟别喷我
    index.php
    <?php
    $name = 123;
    $value = 321; echo "<form action='test.php' method='POST' target='fff'>
    <input type='hidden' name='name' value=$name />
    <input type='hidden' name='value' value=$value />
    <input type='text' size='15' name='xxx' />
    <input type='submit' value='确认' />
    </form>
    <br />
    <iframe src='test.php' name='fff'></iframe>";
    ?>
    test.php
    <?php
    $name = $_POST['name'];
    $value = $_POST['value'];
    $xxx = $_POST['xxx'];
    echo $name."<br />".$value."<br />".$xxx;?>
      

  6.   

    正确!! 谢谢!<html>
      <body>
        <form action="tt4.php" method="POST" target="fff">
            <input type="text" name="name" />
            <input type="text" name="value" />
            <input type="submit" value="submit" />
        </form>
        <br>
        <iframe src="tt4.php" name="fff"></iframe>
      </body>
    </html><?php
        $name = $_POST['name'];
        $value = $_POST['value'];
        echo $name."<br>".$value."<br>";
    ?>