Ok I am trying to make a script that will allow the admin to send email to either one member or all of them at same. I am sure ot have more issues until if figure this all out. Right now I am getting this error : Parse error: parse error, unexpected $ in /home/virtual/site3/fst/var/www/html/brenda-redirect/admin/spam.php on line 66
Now line 66 is the very last line and its not making sense.
<?
require_once "common.php";
checklogin();
dbconnect();
if($action == "spam")
{
if($subject == "" && $content == "")
{
echo "Invalid parameters entered!";
}
else
{
if($mail_to != "all")
{
sendmail($mail_to,$email,$subject,$content);
echo "<b>Mailing done!</b><br><br>";
}
else
{
$query = "SELECT member_id, email, username from member order by username";
while($username = _fetch($query))
sendmail($mail_to,$email,$subject,$content);
{
echo "<b>Mailing done!</b><br><br>";
}
}
}
echo "<H3>Mailing clients</H3>";
?>
<?adminheader()?>
<TABLE>
<FORM ACTION="spam.php?spam" method="post">
<TR>
<TD><FONT SIZE="-1">Mail to:</FONT></TD>
<TD>
<SELECT NAME="mail_to">
<option value="all">All
<?
$query = "SELECT member_id, email, username from member order by username";
while($username = _fetch($query))
?>
</SELECT>
</TD>
</TR>
<TR>
<TD><FONT SIZE="-1">Subject:</FONT></TD>
<TD><INPUT TYPE="text" NAME="subject" SIZE="30"></TD>
</TR>
<TR>
<TD valign=top><FONT SIZE="-1">Letter's body:</FONT></TD>
<TD><textarea name="content" cols="50" rows="10"></textarea></TD>
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="submit" VALUE="Send letters"></TD>
</TR>
</FORM>
</TABLE>