一个非常简单的页面, 上面是一个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吗?多谢了~
=== 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吗?多谢了~
解决方案 »
- PHP怎样去访问客户端的文件?
- PHP精鹰超级群43016622,百G视频书籍陆续加入!
- php如何判断两个浮点数是否可以整数
- 关于PHP中变量引用的问题
- 我错了,再也不犯了,马上跳槽!
- 有个域名查询的程序,老出同样的问题,请指教!!在线等!!
- 关于从MSSQLserver中取出时间并显示的问题!!!看了以前的帖子可是还是有问题,请各位给看看,谢了!很急!
- 从文件中读取内容的问题!!!!!!!!!
- 为什么我运行任何连mysql的程序,他都提示"0 is not a MySQL result index in c:\Apache\htdocs\index.php3 on line XX"??
- 伪静态下面取不到seesion值
- PHP中的 @ 是做什么的?
- 请问能在上传中就改变临时文件的大小马
连嵌入js也不能用
iframe的话,怎么刷新iframe的页面呢?
...............
</form>
<iframe src="test.php" name="itest">
...........
</iframe>
连嵌入js也不能用 为什么不用
我菜鸟别喷我
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;?>
<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>";
?>