Jump to content
Sign in to follow this  
dzhax

Getting PHP Parse error: syntax error, unexpected ''

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...