SEVIZ Posted April 18, 2009 Share Posted April 18, 2009 Thanks to a lot of help from this forum I am getting CLOSE to where I need to be. Here is my current issue. My code: <?php mysql_connect("localhost", "XXXX", "XXXX") or die(mysql_error()); mysql_select_db("TEXT_TOOL") or die(mysql_error()); if (!empty($_POST["email"])) { $q = "select `num` from sprint WHERE `dept` = '".mysql_real_escape_string($_POST["recip"])."'"; $ret = mysql_query($q); $emails = array(); while ($row = mysql_fetch_assoc($ret)) { $emails[] = $row['num'].'@messaging.sprintpcs.com'; } if ($emails) { $ToEmail = implode(', ', $emails); $EmailSubject = $_POST["subject"]."\r\n"; $mailheader = "From: ".$_POST["email"]."\r\n"; $MESSAGE_BODY = nl2br($_POST["message"]); // $MESSAGE_BODY .= ($_POST["auth"]); mail($ToEmail,$EmailSubject, $MESSAGE_BODY,$mailheader) or die ("Failure"); } ?> ---- <?php } else { ?> <form action="text_tool1.php" method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="0"> <tr> <td valign="top"> Send To:<br /> <?php $q = "select `dept` from sprint GROUP BY `dept`"; $ret = mysql_query($q); print '<select name="recip">'; while ($row = mysql_fetch_assoc($ret)) { $email_sec = $row['dept']; print "<option value=\"$email_sec\">$email_sec</option>"; } ?> </select> </td> </tr> <tr> <td>Message:<br /><textarea name=message cols="20" rows="6" id="comment" maxlength="143"></textarea><br /> </td> </tr> <tr> <td> <input name="email" type="hidden" id="email" size="20" value="emailhere"></td> </tr> </table> </form> </body> </html> <?php }; ?> Right now it queries the DB and creates the choices in the dropdown based on groups of the "dept" row titles. This works flawlessly. But I now need to add more options in the same dropdown that combine some existing groups. How would I do this? Right now they show up as Tech, Sup, Bobs, Jims, etc. I now need to add more options that combine them like this: Tech/Sup, Bobs/Jims/Tech, Tech/Sup/Bobs How can I combine the existing options into a new option in the dropdown? Thank you as always! Quote Link to comment Share on other sites More sharing options...
SEVIZ Posted April 18, 2009 Author Share Posted April 18, 2009 If its not possible just let me know. I know there are limitations somewhere. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.