Guest User

Untitled

a guest
May 2nd, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Email Form to specific email addresses based on values selected in MultiSelect Box
  2. $sql="SELECT addr1, city, status FROM listings WHERE status<>'Hidden' ";
  3. $result=mysql_query($sql) or die(mysql_error());
  4. $options="";
  5.  
  6. while ($row=mysql_fetch_array($result)) {
  7.  
  8. $addr1=$row["addr1"];
  9. $city=$row["city"];
  10. $status=$row["status"];
  11. $options.="<OPTION VALUE="$addr1">".$addr1 . ', ' . $city . ' - ' . $status;
  12. }
  13.  
  14. <select multiple name="unit" id="unit" size="10" validate="required:true, rangelength:[1,5]">
  15. <?=$options ?>
  16. </select>
  17.  
  18. addr1 city status manager
  19. address somecity available John Citizen
  20. addresstwo city2 not available Jack Citizen
  21. addressthree city3 available Jill Citizen
  22.  
  23. mail($emailaddresses,$subject,$html,"From: info@#####rnContent-type: text/htmlrn");
Advertisement
Add Comment
Please, Sign In to add comment