Note that there are some explanatory texts on larger screens.

plurals
  1. POParse error: syntax error, unexpected T_STRING on line 1
    text
    copied!<p>I know this error is due to some mismatched brackets, quotes or whatever, still I'm not able to find a solution since my code is working perfectly on localhost but giving me this error on my shared hosting server (same PHP version: 5.3.8)</p> <pre><code>function call_hook() { global $url; $url_array = explode('/', $url); if (isset($url_array[0]) &amp;&amp; $url_array[0] != '') { $controller = $url_array[0]; } else { $controller = DEFAULT_CONTROLLER; } if (isset($url_array[1]) &amp;&amp; $url_array[1] != '') { $action = $url_array[1]; } else { $action = DEFAULT_ACTION; } if (isset($url_array[2])) { $queryString = explode(PARAM_DELIMITER, $url_array[2]); } else { $queryString = array(); } $controller_name = $controller; $controller = ucwords($controller); $model = rtrim($controller, 's'); $controller .= 'Controller'; $dispatch = new $controller($model, $controller_name, $action); if ((int)method_exists($controller, $action)) { // I get the error after this function call call_user_func_array(array($dispatch, $action), $queryString); } else { /* error */ } } </code></pre> <p>This function loads some parameters from the URL and then call the right controller, after the call_user_func_array call it should load the corresponding controller php file but I get this error:</p> <pre><code>Parse error: syntax error, unexpected T_STRING in /web/htdocs/www.mysite.com/home/app/application/controllers/CONTROLLERFILE.php on line 1 </code></pre> <p>This happens with every controller. I've tried to check the code preceding this call but since it's working fine on localhost I don't really know what to look about. The only difference I know of is that magic quotes are Off on localhost and On on the server but I don't know if this</p> <p><strong>EDIT</strong> Also, the start of every controller is: </p> <pre><code>&lt;?php class ControllerName extends Controller { </code></pre> <p>localhost is a Windows system my server is Linux one, if this could matter.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload