【发布时间】:2016-03-27 21:10:46
【问题描述】:
当我的表单操作指向另一个页面时,我想从当前页面获取帖子值。下面是代码示例:
<form id="form1" name="form1" action='page2.php' method="post">
<input type="text" id="test" name="test" value="<?php echo 'test'; ?>" />
<input type='submit' value='submit' />
</form>
//i want to get the value here but it's not working because all value pass to page2.php
$value = $_POST['test'];
echo $value;
建议我如何执行这些家伙!
【问题讨论】:
-
在表单提交之前数据不会存在......然后您将在另一个页面上。不知道你想做什么。
-
将操作更改为当前页面
-
将你的脚本命名为“page2.php”?
-
我要做的是在提交表单后获取帖子值。但我想获取此页面上的值,而不是从执行操作的另一个页面获取值。
-
然后将操作更改为您希望它转到的页面?