Hi all, using a shared Linux server hosted by 1and1. Getting the following error:
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/homepages/34/d421859955/htdocs/mywebsite/cron/sendNotificationMailCron.php</b> on line <b>20</b><br />
Trying to run a php file cron job with code:
<?php
$called_from_cron = true;
require_once(dirname(dirname(FILE)).'/common/configs/config.inc.php');
//compulsory
$CFG['mods']['is_include_only']['html_header'] = false;
$CFG['html']['is_use_header'] = false;
class NotificationMailCron extends FormHandler
{
/**
newLetterCron::sendNewsLetter()
@ mixed $table_name
@ array $fields_arr
@ mixed $new_letter_arr
@ mixed $CFG
@return
/
public function sendNewsLetter()
{
$sql = ' SELECT * FROM '.$this->CFG['db']['tbl']['notification_mail'].' WHERE priority = \'Low\''.
' ORDER BY notification_mail_id ASC LIMIT '.$this->CFG['news_letter']['send_count'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, array());
if (!$rs)
trigger_db_error($this->dbObj);
if($rs->PO_RecordCount())
{
$EasySwift = new EasySwift($this->getSwiftConnection());
while($row = $rs->FetchRow())
{
$EasySwift->flush();
$EasySwift->addPart($row['body'], "text/html");
$EasySwift->send($row['to_email'], $row['from_email'], $row['subject']);
$last_id = $row['notification_mail_id'];
}
$sql = 'DELETE FROM '.$this->CFG['db']['tbl']['notification_mail'].' WHERE priority = \'Low\' AND'.
' notification_mail_id <= '.$this->dbObj->Param('notification_mail_id');
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, array($last_id));
if (!$rs)
trigger_db_error($this->dbObj);
echo 'successfully send';
}
}
}
//<<<<<-------------- Class LoginFormHandler begins ---------------//
//-------------------- Code begins -------------->>>>>//
$NotificationMailCron = new NotificationMailCron();
callMultipleCronCheck();
$NotificationMailCron->sendNewsLetter();
//require_once($CFG['site']['project_path'].'common/application_bottom.inc.php');
?>