Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING o
Hey guys having some problems with a bit of code, if anyone can help out that would be excellent.
Error : Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\sites\Project\adminmodsubown.php on line 75
PHP Code:
case "accept":
$validid = set_validid();
$sql = "SELECT mod_subowner.sub_id, subjects.subject, users.id AS userid, users.username, users.email FROM mod_subowner INNER JOIN subjects ON
mod_subowner.sub_id = subjects.id LEFT JOIN users ON
mod_subowner.user_id = users.id WHERE mod_subowner.id = " . $validid . ";";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$numrows = mysql_num_rows($result);
$mail_body=<<<_MESSAGE_
Hi, $mail_username,I am pleased to inform you that you have been accepted as the new owner of the '$mail_subject' subject.When you next log into '$config_sitename' you will see the subject in your Control Panel.King Regards,$config_sitename Administrator _MESSAGE_;
mail($mail_email, "Ownership Request For " . $mail_subject . " accepted!", $mail_body);
$addsql = "UPDATE subjects SET owner_id = " . $row['userid'] . " WHERE id = " . $row['sub_id'] . ";";
mysql_query($addsql);
$delsql = "DELETE FROM mod_subowner WHERE sub_id = " . $row['sub_id'] . ";";
mysql_query($delsql);
$mail_body=<<<_MESSAGE_
Hi, $mail_username,I am pleased to inform you that you have been accepted as the new owner of the '$mail_subject' subject.When you next log into '$config_sitename' you will see the subject in your Control Panel.King Regards,$config_sitename Administrator _MESSAGE_;
mail($mail_email, "Ownership Request For " . $mail_subject . " accepted!", $mail_body);
$addsql = "UPDATE subjects SET owner_id = " . $row['userid'] . " WHERE id = " . $row['sub_id'] . ";";
mysql_query($addsql);
$delsql = "DELETE FROM mod_subowner WHERE sub_id = " . $row['sub_id'] . ";";
mysql_query($delsql);
$validid = set_validid();
require("header.php");
echo "<h1>Are you sure that you want to deny this request?</h1>";
echo "<p>[<a href='adminmodsubown.php?func=denyconf&id=" . $validid . "'>Yes</a>]
[<a href='adminmodsubown.php?func=main'>No</a>]";
break;
case "denyconf":
$validid = set_validid();
$sql = "SELECT mod_subowner.sub_id, subjects,subject, users.id AS userid, users.username, users.email FROM mod_subowner INNER JOIN
subjects ON mod_subowner.sub_id = subjects.id LEFT JOIN users ON mod_subowner.user_id = users.id WHERE mod_subowner.id = " . $validid . ";";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$numrows = mysql_num_rows($result);
$mail_body=<<<_MESSAGE_
Hi $mail_username, I am writing to infom you that your request for ownership of the '$mail_subject' subject has been declined. Better luck next time. King Regards, $config_sitename Administrator _MESSAGE_;
mail($mail_email, "Ownership Request For " . $mail_subject . " Denied!", $mail_body);
$delsql = "DELETE FROM mod_subowner WHERE id = " . $validid . ";";
mysql_query($delsql);
Its cool,
tried that code same error i think its to do with the mail function
$mail_body=<<<_MESSAGE , I could be wrong tho i had spaces and i closed them all off and then it started displayed that new error! if that helps any
thanks
$mail_body=<<<_MESSAGE_
Hi, $mail_username,I am pleased to inform you that you have been accepted as the new owner of the '$mail_subject' subject.When you next log into '$config_sitename' you will see the subject in your Control Panel.King Regards,$config_sitename Administrator _MESSAGE_;
its at end of text do you think it needs to be on a new line?