Menu
I’m trying to use a foreach loop in a header(‘Location: .. type script. Is there any way to do this?
I need to hold both the key and value variables in 2 of my sql calls. If anyone has a solution to this, that would be great.
[code=php]header(‘Location: ../checkout/cart/add?product=’.$id.’&qty=1&options[‘ . $dropdown_id . ‘] = ‘ . $dropdown_selection_id
foreach($options_array as $key => $value)
{
echo ‘&options[‘ . $key . ‘]=’ . $value;
}
);
This gives me a syntax error as you would imagine.