📜  如何清除引用时的帖子数组+返回时不重新填充 - PHP代码示例

📅  最后修改于: 2022-03-11 14:53:47.706000             🧑  作者: Mango

代码示例1
if (!isset($_SESSION)) {
session_start();
}

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['postdata'] = $_POST;
unset($_POST);
header("Location: ".$_SERVER[REQUEST_URI]);
exit;
}

if (@$_SESSION['postdata']){
$_POST=$_SESSION['postdata'];
unset($_SESSION['postdata']);
}