你可以从表单中做到这一点。如果这是你找什么:
<form method="post" id="formArea" action="<?PHP $_SERVER['PHP_SELF'];?>">
//this will make the form post to same page as the form
如果你想送这既可以节省$_POST
数据在一个变量和以后使用。 EX:
<?PHP
//your form submit code might look something like this same file as your form
if(isset($_POST['submit']))
{
foreach($_POST as $key -> $value)
{
//echo or show your values or store your values in database or w/e
$_SESSION['post'][$key] = $value;
//this will make a session variable to be used again later each session array is marked with post identified by $key and stored a $value
}
//you can call your other page here this will only run after this page runs and loads your information above and then redirect with a session variable.
header("Location: redirect.html");
}
else
{
echo "<form method=\"post\" id=\"formArea\" action=\"".$_SERVER['PHP_SELF']."\">";
}
这个代码是未经测试,但它会工作的将redirect.html将从$_SESSION['post']
对不起进程的代码,但目前还不清楚你问什么...什么是'redirect.flx' ?输出线的意义是什么?你为什么不简单地试试,如果有可能,而不是问我们呢? – arkascha
redirect.flx只是一个html文件。它会将用户重定向到新页面并显示他们输入的信息。我没有尝试过,因为我不在家,无法连接到服务器 – Continuum
现在你的问题更加不清楚了:'action =“action.php”'会导致对'action.php'文件的请求。为什么应该有一个'redirect.html'文件发挥作用?还有什么好的附加文件呢? – arkascha