Error
Posted: Wed Jan 01, 2003 4:50 pm
can anyone help me on how to solve this problem please.
I get an error at the denoted text in the code below.
I get an error at the denoted text in the code below.
Code: Select all
<?php
if(empty($SEND)){$SEND="";}
switch($SEND){
case "Send":
if(!empty($MESSAGE)){
if(empty($SUBJECT)){$SUBJECT=""}; <- here is my problem
$HEADERS = "MIME-Version: 1.0\r\n";
$HEADERS .= "Content-type: text/html; charset=iso-8859-1\r\n";
$HEADERS .= "Wrom: BRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDM
$linkID = mysql_connect([localhost [80] [<img src="images/smilies/tongue.gif" border="0" alt="">ath/to/socket], [user], [pass]);
mysql_select_db([database], $linkID);
$obRS = mysql_query("SELECT email FROM users", $linkID);
while($row = mysql_fetch_row($obRS)){
foreach ($row as $field){
mail($field, $SUBJECT, $MESSAGE, $HEADERS);
print "Message sent to: <b>$field</b><br>";
}
}
mysql_close($linkID);
print "<hr><b>MESSAGE DETAILS</b><hr>";
print "<b>Subject:</b> $SUBJECT<br>";
print "<b>Message:</b><p>$MESSAGE";
}
break;
case "Preview":
print "<TABLE BORDER=1 CELLSPACING=0 WIDTH=100% ><TR><TD VALIGN=TOP>$MESSAGE</TD>";
print "<TD VALIGN=TOP><FORM ACTION=AutoMail.php METHOD=POST NAME=FORM1 >";
print "<B>SUBJECT: </B><Input TYPE=TEXT NAME=SUBJECT VALUE='$SUBJECT' ><BR>";
print "<TEXTAREA NAME=MESSAGE STYLE='width:500;height:300' WRAP=off >$MESSAGE</TEXTAREA><BR>";
print "<INPUT TYPE=SUBMIT VALUE=Preview NAME=SEND > <INPUT TYPE=BUTTON ONCLICK="document.FORM1.MESSAGE.value=''" VALUE=Reset > <INPUT TYPE=SUBMIT VALUE=Send NAME=SEND > ";
print "</FORM></TD></TR></TABLE>";
break;
default:
print "<FORM ACTION=AutoMail.php METHOD=POST NAME=FORM1 >";
print "<B>SUBJECT: </B><Input TYPE=TEXT NAME=SUBJECT VALUE='' ><BR>";
print "Please type in html code below.<BR>";
print "<TEXTAREA NAME=MESSAGE STYLE='width:500;height:300' WRAP=off ></TEXTAREA><BR>";
print "<INPUT TYPE=SUBMIT VALUE=Preview NAME=SEND > <INPUT TYPE=BUTTON ONCLICK="document.FORM1.MESSAGE.value=''" VALUE=Reset > <INPUT TYPE=SUBMIT VALUE=Send NAME=SEND > ";
print "</FORM>";
}
?>