I have a form that uses Multiple Listbox to allow the user to choose multiple selections. I need to parse these selections to then email the information.
Code snippet:
=============================
<select name='select[]' size='5' multiple>");
do {
print("<option value='");
echo $row_Recordset1['catagory']; print("'>");
echo $row_Recordset1['catagory']; print("</option>");
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
</select>
Then this is the code snippet for creating and mailing the information:
====================
$re = "Contact Form Entry";
$list = implode(",", $select);
$msg = "FROM: $_POST[name]
$_POST[company]
$_POST[address]
$_POST[city], $_POST[state] $_POST[zip]
Phone: $_POST[phone] Fax: $_POST[fax]
$_POST[email]
$_POST($list)
$_POST[msg]";
$headers .= "From: $_POST[webmail] \r\n";
$myemail = "$youremail";
mail($myemail,$re,$msg, $headers);
============================================
This is the output of an email:
================================
FROM: admin
ABC Company Name
123 Street Address
SomeCity, ST 55555
Phone: 555-123-4567 Fax: 555-123-4567
[email protected]
Array(Accuride,Layed Up Panels,Acrylic Sheets)
Message box in put
=============================
The problem is that the array prints like this:
'Array(Accuride,Layed Up Panels,Acrylic Sheets)'
I can live with it but it would be nicer to have the items list this:
Accuride,Layed Up Panels,Acrylic Sheets
Thanks for any help.