how can i command this into a statement that will just put all the $_POST[] into a session without have to write each line out.
<?php session_start();
$_SESSION['s_type'] = $_POST['s_type'];
$_SESSION['s_uname'] = $_POST['s_uname'];
$_SESSION['s_email'] = $_POST['s_email'];
$_SESSION['s_promo'] = $_POST['s_promo'];
$_SESSION['s_ctry'] = $_POST['s_ctry'];
?>
$_SESSION['POST'] = $_POST;
echo $_SESSION['POST']['s_type'];
If you don't like the nesting of Marc B,
foreach ($_POST as $k => $v){
$_SESSION[$k] = $v;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With