Thanks 4 ur kind reply...Will you mind if I need your assistance again....
Here is my total code...Here the check box is kept in loop.And their number depends on the data in the Mysql tables.So I cud n't initiate all of them.They must also be done dynamically.After I select the checkboxes(may be one or more) mail must be sent to expert(One or more,depending on the selection of the check box)...
[PHP]<html>
<body>
<?php
mysql_connect("localhost","root") or die(mysql_error());
mysql_select_db("db_soft") or die(mysql_error());
$result = mysql_query("SELECT sfa_experts.display_name, sfa_skills.skill_name, sfa_skills.skill_desc
FROM sfa_experts, sfa_skills, sfa_expert_skills
WHERE sfa_experts.expert_uid = sfa_expert_skills.expert_uid
AND sfa_skills.skill_uid = sfa_expert_skills.skill_uid");
echo "<table border='1' align=center >
<tr>
<th>Expert Name</th>
<th>Profile</th>
<th>Area of Experience</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td> <input type='checkbox' name='check[][]'>" . $row['display_name'] . "</td>";
echo "<td>" . $row['skill_name'] . "</td>";
echo "<td>" . $row['skill_desc'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close();
?>
Ask Question:
<TEXTAREA name="question" cols=55> </TEXTAREA><br><br>
<br><br>
<form method="POST" action="">
<input type="submit" name="action" value="AskExpert"/>
</form>
<?php
if ($_POST['action'] == "AskExpert")
{
$email="expert@gmail.com";
$mail = new COM('iMSMail.SendMail');
$mail->SpoolDir = 'C:\Program Files\...';
$mail->setheader('To',$email);
$mail->setheader('From','user@abc.com');
$mail->setheader('Subject','Ask your question!');
$mail->body='you can ask question by slecting appropriate expert';
$mail->sendmail();
print $mail->Result;
print "<br>Your email was sent to ";
print $mail->TotalRecipients;
print " recipients from a total of ";
print $mail->InputRecipients;
}
?>
</body>
</html>[/PHP]
Thanks & regards,
Purush.