Would you look at some code?

Would you look at some code?

am 14.11.2005 00:20:25 von Ron Piggott

I am getting the parse error message

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or
'$' line 121

I wondered if some of you would look at this code and see if you could
find the source of it. I have been looking at the code for an hour now
and haven't found it.

The purpose of this is to determine if there is a pre-programmed mailing
by looking in the member_upcoming_mailings_to_do table. If so then we
take the results of which mailing list has a pre-programmed mailing,
find out the member reference numbers from the
active_member_subscriptions and then look in the member_accounts where
their e-mail address is actually stored. Somehow I have created the
parse error and not sure why.

Ron


#!/

$username="USER";
$password="PASSWORD";
$database="DATABASE";
$todays_date=DATE("Y-m-d");

#are there mailings for today

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM member_upcoming_mailings_to_do WHERE
date_to_send_out = '$todays_date'";
$mailing_result=mysql_query($query);
$number_of_mailings_to_do=mysql_numrows($mailing_result);
mysql_close();

$i=0;
while ($i < $number_of_mailings_to_do) {

$list=mysql_result($mailing_result,$i,"list");
$web_page_address=mysql_result($mailing_result,$i,"web_page_ address");

#who needs to receive this mailing? What is their account reference
number?

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM active_member_subscriptions WHERE list =
'$list'";
$subscription_result=mysql_query($query);
$number_of_subscriptions=mysql_numrows($subscription_result) ;
mysql_close();

$ii=0;
while ($ii < $number_of_subscriptions) {

$member_reference=mysql_result($subscription_result,
$ii,"member_reference");

#according to their account reference number what is their e-mail
address

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM member_accounts WHERE record =
'$member_reference'";
$member_result=mysql_query($query);
mysql_close();

$email = mysql_result($member_result,$iii,"email");

#according to the mailing type who is this mailing from?

if ( $list == "1" ) {

#verse of the day news and annoucements
$headers = "From: office@actsministries.org\r\n";
$mailing_description = "Verse of the Day news and annoucements ";

} elseif ( $list == "2" ) {

#e-mail edition of the Christian Discipleship Mailing List
$headers = "From: discipleship@actsministries.org\r\n";
$mailing_description = "Christian Discipleship Mailing List e-mail
edition ";

} elseif ( $list == "3" ) {

#north america edition of the Christian Discipleship Mailing List
$headers = "From: discipleship@actsministries.org\r\n";
$mailing_description = "North America Christian Discipleship ";

} elseif ( $list == "4" ) {

#over seas edition of the Christian Discipleship Mailing List
$headers = "From: discipleship@actsministries.org\r\n";
$mailing_description = "Over seas Christian Discipleship ";

} elseif ( $list == "5" ) {

#ministry news and updates e-mail list
$headers = "From: office@actsministries.org\r\n";
$mailing_description = "Ministry News and Updates ";

} elseif ( $list == "6" ) {

#for test purposes
$headers = "From: ron.piggott@actsministries.org\r\n";
$mailing_description = "Test purposes ";

}

#need to revise the reply to and return path to correspond with mailing
type later

$headers .= "Reply-To: discipleship@actsministries.org\r\n";
$headers .= "Return-Path: discipleship@actsministries.org\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

#load the file into a variable

$lineArray = file("$web_page_address");

// make an empty variable first
$message = "";

// concat all array element
foreach($lineArray as $eachLine) {
$message .= $eachLine;
}

$subject = strstr($message, '');<br /> $subject = explode("", $subject);
$subject = $subject[0];

# result has at the start - now to get rid of <title><br /> <br /> $subject = strstr($subject, '>');<br /> $subject = str_replace('>','',strstr($subject, '>'));<br /> <br /> #now e-mail out the mailing<br /> <br /> mail($email,$subject,$message,$headers);<br /> <br /> echo $mailing_description . " mailing for " . $todays_date . " sent to<br /> member " . $member_reference . "<br /> ";<br /> <br /> ++ii;<br /> }<br /> <br /> ++i;<br /> }<br /> ?><br /> <br /> -- <br /> PHP Database Mailing List (http://www.php.net/)<br /> To unsubscribe, visit: http://www.php.net/unsub.php</p> </article> <article> <h2>Re: Would you look at some code?</h2><span>am 14.11.2005 02:26:54 von Ajree</span> <p>Ron Piggott wrote:<br /> > I am getting the parse error message<br /> > <br /> > Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or<br /> > '$' line 121<br /> <br /> (...)<br /> <br /> > ++ii;<br /> > }<br /> > <br /> > ++i;<br /> > }<br /> > ?><br /> <br /> Shouldn't you write:<br /> <br /> ++$ii;<br /> }<br /> <br /> ++$i;<br /> }<br /> ?><br /> <br /> :) ? It's the variable sign '$' what is missing here.<br /> <br /> --<br /> Ajree<br /> <br /> -- <br /> PHP Database Mailing List (http://www.php.net/)<br /> To unsubscribe, visit: http://www.php.net/unsub.php</p> </article> <article> <h2>Re: Would you look at some code?</h2><span>am 14.11.2005 04:45:58 von Ron Piggott</span> <p>Thanks. I didn't understand what this error message was saying to me.<br /> Ron<br /> <br /> On Sun, 2005-13-11 at 18:20 -0500, Ron Piggott wrote:<br /> > I am getting the parse error message<br /> > <br /> > Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or<br /> > '$' line 121<br /> <br /> -- <br /> PHP Database Mailing List (http://www.php.net/)<br /> To unsubscribe, visit: http://www.php.net/unsub.php</p> </article> <footer> <a href="/">Index</a> | <a href="/impressum.php">Impressum</a> | <a href="/datenschutz.php">Datenschutz</a> | <a href="https://www.xodox.de/">XODOX</a> </footer> </main> </body> </html>