send message to many recipients
hi all...
i need to make one form that enable administrator to send message to many recipients. im using php and mysql.that means the recipients will recieve the same message. anyone could help me?
thanks ya....
here is the form
(1)
<? //form.php ?>
<form action="send.php" method="post">
<?php
if (isset($_POST['move']))
{ ?>
To: <textarea name="reci" cols="50" rows=""><? echo "" . join(', ', $_POST['move']) . ".\n"; ?></textarea>
<? }
echo "<br />\n";
echo "<a href=\"form1.php\">Insert Address</a>\n";
?><br>
Message: <textarea name="mesej" cols="" rows=""></textarea>
<input type="submit" name="Submit" value="Send">
</form>
***************************
(2)
<? //form1.php ?>
<script>
<!--
function selectAll(f,n,v) {
var chk = ( v == null ? true : v );
for (i = 0; i < f.elements.length; i++) {
if( f.elements[i].type == 'checkbox' &&
f.elements[i].name == n ) {
f.elements[i].checked = chk;
}
}
}
//-->
</script>
<?php
$link = mysql_connect("localhost","root","");
$database = mysql_select_db("test");
//include 'function.php';
?>
<?
$q = mysql_query("select * from test1");
while($d = mysql_fetch_array($q)){
//}
?>
<form method="post" action="form.php" name="myform">
<input type="checkbox" name="move[]" value="<? echo $d[email];?>"><? echo $d[email];?></input><br/>
<? } ?>
<input type="submit" value="insert checked contacts" />
<input type="button" onClick="selectAll(this.form,'move[]')" name="butt"
value="select all">
<input type="button" onClick="selectAll(this.form,'move[]',false)"
name="butt" value="unselect all"></form>
</body>
</html>
|