Page 1 of 1

Unexpected token '' -- PHP Tools v1.22.9523.2015

PostPosted: February 22nd, 2017, 6:13 pm
by Blitzstromunger
Severity Code Description Project File Line Column Suppression State
Error Syntax error: unexpected token '' RWB forms_select.php 9 1

<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}

if(isset($_POST['scan_CT_contrast_consent'])){
$_SESSION['CT_contrast_consent'] = true;
$_POST['currentPage'] = 'CT_contrast_consent';
}else{
if(isset($_SESSION['CT_contrast_consent'])){
unset($_SESSION['CT_contrast_consent']);
}
}
?>

Error is on "}else{" line column 1.

Re: Unexpected token '' -- PHP Tools v1.22.9523.2015

PostPosted: February 22nd, 2017, 6:17 pm
by Blitzstromunger
It appears this only occurs when the page also contains nested html and if statements, like:


<?php
if(true){
?>
<html>
<?php
if (false){
?>
</html>
<?php
}
}
?>

Re: Unexpected token '' -- PHP Tools v1.22.9523.2015

PostPosted: February 22nd, 2017, 6:34 pm
by Blitzstromunger
Please mostly ignore this post, it was a dangling curly bracket causing the issue. It would be nice if it tracked the line number a little better, it appears to only count lines of php code, not html.