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

后端 未结 4 608
粉色の甜心
粉色の甜心 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:09

    i would instead foreach the $_POST and add it to $_SESSION['mypostvars']. Keep in mind that you should validate and verify the $_POST before storing them.

    this is a possible duplicated of PHP merge $_POST into $_SESSION

提交回复
热议问题