I keep getting a parse error
Code:Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/sites/normanbar.co.uk/public_html/admin/send.php on line 38
I'm unsure why as i can't locate it in the code. Any tips?
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Norman Bar Admin</title>
</head>
<body>
<div id="main">
<h1>Newsletter Sent</h1>
<p><a href="index.php">Back</a></p>
<p>Your newsletter has been sent to
<?php
if ($_POST['test'] == 'on') {
?>
yourself only.
<?php
}else {
?>
all subscribed users.
<?php
}
?>
<BR>Thank You</p>
<?php
class Envy_Mailer {
public $Subject = 'No subject specified';
public $XMailer = 'Envy Point Mailer';
public $RecipientsList = array();
public $SenderName = 'Leeds';
public $SenderEmail = gh@h.com';
public $Message = 'No message content specified';
public function __construct (){
}
/**
* Add recipient to the mailing list
*
* @param $Name string
* @param $Email string
* @access public
* @return
*/
public function AddRecipient ($Name = 'Customer', $Email) {
$this->RecipientsList[] = array ($Name, $Email);
}
/**
* Send e-mail to all recipients
*
* @access public
* @return
*/
public function Send (){
$Headers = 'From: '.$this->SenderName.' <'.$this->SenderEmail.'>'. "\r\n";
$Headers .= 'Content-type: text/html; charset=iso-8859-1\r\n';
$headers .= "MIME-Version: 1.0\r\n";
$Headers .= 'X-Mailer: '.$this->XMailer.'\r\n';
foreach ($this->RecipientsList as $Recipient) {
mail($Recipient[1], $this->Subject, stripslashes($this->Message), $Headers);
}
}
}
mysql_connect('localhost', '88888', '54545');
mysql_select_db('5454545');
$query_news = "select * from register where newsletter = '1' order by id DESC";
$result_news = mysql_query($query_news) or die(mysql_error());
$file_news = mysql_fetch_array($result_news);
$total_rows_news = mysql_num_rows($result_news);
if (!$result_news)
{
print 'There was a database error when executing';
print mysql_error();
exit;
}
$Mail = new Envy_Mailer ();
$Mail->SenderName = $_POST['author'];
$Mail->Subject = $_POST['title'];
$Mail->Message = $_POST['message'];
if ($_POST['test'] == 'on') {
$Mail->AddRecipient ($Mail->SenderName, $Mail->SenderEmail);
} else{
do {
$Mail->AddRecipient ($file_news['name'], $file_news['email']);
} while ($file_news = mysql_fetch_array($result_news));
}
$Mail->Send();
?>







Bookmarks