Hi, I need help figuring out what's wrong with my script. I've read several tutorials and manuals and I can't find the problem. I'm out of ideas now and I'd appreciate some insight from you fine folks.
I'm getting: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /home/path/send.php on line 24
Line 24 is: $subject = "$_POST['subject']"; from the following script.
<?
$username="u";
$password="p";
$database="db";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$sql = "SELECT email FROM table1";
$result = "mysql_query($sql)";
$row = "mysql_fetch_array($result)";
//data from the message.php page
$subject = "$POST['subject']";
$message = "$POST['message']";
//Send message loop
While ($row) {
$email = "$row['email']";
//Take notice that we've included $subject and $message below
mail("$email","$subject","$message","From: me@mydomain.com");
}
echo("Newsletter sent!");
?>