I've got my form all completed, I know how to set a singular cookie using PHP however what is the best format to set a cookie string. I would like to have a cookie like so (or similar, my formatting is just an example);
Prefs[theme=this&layout=that]
How would I set a cookie like so and then get the information from my string?
Code So Far:
<?php
if (isset($_POST['submitted'])) {
$a = gmdate("M d Y H:i:s");
$b = "Cookies=true&Cookies_Accepted=" . $a . "";
$c = $_POST["APT_SELECTED"];
$d = $_POST["APPT_SELECTED"];
if ($d == 'Custom') {
$d = $c;
};
$e = $_POST["APL_SELECTED"];
$f = $_POST["APTNP_SELECTED"];
$g = $_POST["APSNP_SELECTED"];
$h = $_POST["APSNM_SELECTED"];
$i = $_POST["ScreenTimeout"];
$j = time() + (10 * 365 * 24 * 60 * 60);
$k = "/admin/";
$l = "rafflebananza.com";
$m = array(
'APCA' => 'true',
'APCAW' => $a,
'APT' => $c,
'APPT' => $d,
'APL' => $e,
'APTNP' => $f,
'APSNP' => $g,
'APSNM' => $h,
'APLSA' => $i
);
foreach ($m as $n => $o) {
setcookie("RBAP_Prefs[$n]", $o, $j, $k, $l);
};
header("Location: http://admin.rafflebananza.com/incex.php");
};
?>
setcookiemultiple times, one for each value you want to set, right?