I’m having trouble matching a post with a session array.
the session name holds the post value.
so
$_SESSION['forms']['inputname'] = '123abc456xyz';
<input type="submit" name="123abc456xyz" value="abc123xyz456" />
which is a result of
<input type="submit" name="<?php echo $_SESSION['forms']['inputname']; ?>" value="" />
i have three names. i tried to check for a match using array options from php manual. i could read only one name. all three posts echo the same name.
for example:
$input = $_SESSION['forms'];
foreach ($_POST as $input) {
if (in_array($_POST, $input)) {
$request = array_search($_POST, $input);
}
}
i had it matching only the first session, so it isn’t matching the post that was submitted. I am not very experienced with arrays, so i am struggling to figure out a method that works.
astonecipher and benanamen know my code all ready, for anyone else that can help: the name and value of the input is randomized, so only the session key can separate the posted form.
i need a way to match the post with the session key, so value to name.