February 1, 2012
Preserve $_POST variables through different pages like $_SESSION
Question by Starx
Once some data are submitted through POST, is it possible to make them available as $_POST through different pages, same like how $_SESSION allows us to do?
Answer by Starx
Digging up an old question today. But i forgot to post the working solution I dug….
Place this snippet in top of your every page
if(isset($_POST) & count($_POST)) { $_SESSION['post'] = $_POST; }
if(isset($_SESSION['post']) && count($_SESSION['post'])) { $_POST = $_SESSION['post']; }