I am making a mail form with a the CC being selected from 'Multiple' select list, which, is being generated from a database using PHP.
The deal is, the echoed CC values, regardless of how many are selected returns only the 1 which is lowest on the list.
for example, if of:
1
2
3
4
I selected:
1
2
4
Then 4 would be the final value. Why would this be? Isn't that the point of the multi-select?
I can post the code if needed.
SELECT:
Code: Select all
<select name="cc" size="8" multiple="multiple">
<option value="0">No Assignment</option>
<option value="0">-------------</option>
<?
$sql = "SELECT COUNT(*) FROM it_mem WHERE Mem_X=0 AND Mem_Level!='0'";
$numrecord = mysql_query($sql);
$numrecords = mysql_fetch_array($numrecord);
$intRecsPerPage=100;
if($_POST["intpage"]=="")
{
$intpage=1;
}
$sql2 = "SELECT * FROM it_mem WHERE Mem_X=0 AND Mem_Level!='0' ORDER BY Mem_LName";
$resultassignment = mysql_query($sql2) or die (mysql_error());
for($x = (($intpage-1) * $intRecsPerPage); $x < (($intpage-1) * $intRecsPerPage) + $intRecsPerPage; $x++)
{
if($x/2 != intval($x/2))
{
$bgcolor = "#ffffff";
}
else
{
$bgcolor = "#F7F7F7";
}
if($x >= $numrecords[0])
{
break;
} // REPEAT IF MORE THAN ONE
$assignmentresults = mysql_fetch_array($resultassignment);
echo "<option value='$assignmentresults[Mem_Email]'>";
echo "$assignmentresults[Mem_LName], $assignmentresults[Mem_FName] ";
echo "</option>";
}?>
</select>MAIL FUNCTION:
Code: Select all
$cc=$_REQUEST["cc"];Code: Select all
$address = $toEmail';
$subject = "RE:[Ticket: $issueID] $title";
$headers = 'From: admin@honeycombworldwide.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers .= "Reply-To: admin@honeycombworldwide.com\r\n";
$headers .= "Return-Path: admin@honeycombworldwide.com\r\n";
$headers .= "CC: $cc.', ';
mail($address, $subject, $mail_body, $headers);