Why does this `$_SESSION = $_POST` fail?

后端 未结 4 613
粉色の甜心
粉色の甜心 2021-01-28 06:04

What am I missing here? This is my PHP file:

\";
echo print_r($_POST);

// Save input in sessio         


        
4条回答
  •  执念已碎
    2021-01-28 06:27

    You can modify $_SESSION but I don't think you're allowed to reassign it like that. Instead, copy the members of $_POST into it. Try using array_merge() but if that doesn't work then write a foreach loop to do it.

提交回复
热议问题