Jump to content

Getting PHP Parse error: syntax error, unexpected ''


dzhax

Recommended Posts

Hello All,I am working on a new project and getting an error that is driving me nuts.Error:PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /../example.php on Line 215Here is my code around that line count.

require '../SourceQuery/SourceQuery.class.php';
define('SQ_SERVER_ADDR', 'localhost');define('SQ_SERVER_PORT', 27015);define('SQ_TIMEOUT', 3);define('SQ_ENGINE', SourceQuery :: SOURCE);	$ServerQuery = new SourceQuery();		$ServerInfo = Array();		try{  $ServerQuery->Connect(SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE);  $ServerInfo = $ServerQuery->GetInfo();} catch(Exception $e){  $Exception = $e;}		$ServerQuery->Disconnect();if($ServerInfo['Players'] > 0){  $output = "Failed to restart server. The Server is not empty.";  mail($from, "Response: Restart", $output, 'From: noreply@domain.name' . "rn" . 'Reply-To: noreply@domain.name' . "rn" . 'X-Mailer: PHP/' . phpversion());} else {  restartServer();  $output = "Server has been restarted. It Should be up shortly.";  mail($from, "Response: Restart", $output, 'From: noreply@domain.name' . "rn" . 'Reply-To: noreply@domain.name' . "rn" . 'X-Mailer: PHP/' . phpversion());}
Throughout my search this issue seems to come up around the quotations being incorrectly used. Most help posts were PHP MySQL related and they were not putting quotes around their string values. This does not appear to be the case. At least from what I can gather.Any insight would be grateful.
Link to comment
Share on other sites

You can verify for yourself. Copy the code you pasted up there, add the "<?php" to the start of it, and check:http://www.piliapp.com/php-syntax-check/PHP 5 does not indicate an error. Any syntax error is not present in the code you posted here. I'm not saying there's not an error, just that you didn't post one.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...