I’m having a problem receiving the full amount of information i need on a grocery order from that i’m accessing inputted values using form to mail in php.
my form looks like this:
here is my php code to send it to my email:
foreach($_POST as $key){
if (is_array($key)){
$message.=“Category: $key\n”;
foreach($key as $row){
$message.=“Item: $row\n”;
foreach($row as $col => $val){
$val = stripslashes($val);
$message.="$col: $val\n";
}
}
}
}
And here is what shows up in my email:
Category: Array
Item: Array
0: Stella
1: 6 pack
2: Cold
Item: Array
0: Merlot
1: 750ml
2:
Item: Array
0: Whiskey
1:
2: With cup
I’ts really a very handy script, except i can’t seem to gather anything but ‘array’ from $key and $row.
How can I make the index name of the nested array display in my email, instead of ‘array’
This is how i want it to look:
Category: BeerandWine
Item: Beer
0: Stella
1: 6 pack
2: Cold
Item: Wine
0: Merlot
1: 750ml
2:
Item: Liquor
0: Whiskey
1:
2: With cup
and i also want to have:
Type/Brand:, Quantity:, Notes:
instead of:
0:, 1:, 2:
and not display the empty values, but those I could probably find on my own after I solve this…I’ve been searching for a solution to this for days. Any help?