php 怎样在输出一个变量之后将它清空

来源:百度知道 编辑:UC知道 时间:2024/06/07 06:22:26
表单输入一个值
我想实现再次刷新页面时又回到表单输入状态
以下是我的代码

$a=$_POST['a'];

if($a = "")
{
echo"<form id=\"a\" name=\"a\" method=\"post\" action=\"text.php\">"
. " email:"
. " <input name=\"a\" type=\"text\" id=\"a\" />"
. " <input type=\"submit\" value=\"确定\" />"
. "/form>"
."";
}
else
{
echo $a;
$a="";
$_POST['email']="";
}

<?
$a=$_POST['a'];

if($a == "")
{
echo"<form id=\"a\" name=\"a\" method=\"post\" action=\"test.php\">"
. " email:"
. " <input name=\"a\" type=\"text\" id=\"a\" />"
. " <input type=\"submit\" value=\"确定\" />"
. "</form>"
."";
}
else
{
echo $a;
$a="";
$_POST['a']="";
}
?>

声明:
当一个表单页,已经提交数据到另一页面的时候,如果刷新接收页会出现重试等提示。

unset($a);