dzhax Posted September 1, 2015 Share Posted September 1, 2015 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 More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 The code you posted doesn't have a syntax error. Link to comment Share on other sites More sharing options...
dzhax Posted September 1, 2015 Author Share Posted September 1, 2015 that's what i figured. but the error log begs to differ. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now