nomadsoul Posted April 13, 2013 Share Posted April 13, 2013 Greetings and good day to all you Ullmanites, I'm getting this when I access index.php through the url: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\ecommerce\virtual\knowledge\html\includes\config.inc.php on line 67 here is the local code, nothing much before that except the define functions and the session variable: function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { // Need these two vars: global $live, $contact_email; // Build the error message: $message = "An error occurred in script '$e_file' on line $e_line:\n$e_message\n"; THIS IS LINE 67 it is empty // Add the backtrace: $message .= "<pre>" .print_r(debug_backtrace(), 1) . "</pre>\n"; // Or just append $e_vars to the message: // $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n"; I'm not seeing any semicolon problems or missing syntax. Thanks Link to comment Share on other sites More sharing options...
laurent vignaux Posted April 13, 2013 Share Posted April 13, 2013 hello 'nomadsoul', perhaps the problem could be after so look well the full script function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { // Need these two vars: global $live, $contact_email; // Build the error message: $message = "An error occurred in script '$e_file' on line $e_line:\n$e_message\n"; // Add the backtrace: $message .= "<pre>" .print_r(debug_backtrace(), 1) . "</pre>\n"; // Or just append $e_vars to the message: // $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n"; if (!$live) { // Show the error in the browser. echo '<div class="error">' . nl2br($message) . '</div>'; } else { // Development (print the error). // Send the error in an email: error_log ($message, 1, $contact_email, 'From:admin@example.com'); // Only print an error message in the browser, if the error isn't a notice: if ($e_number != E_NOTICE) { echo '<div class="error">A system error occurred. We apologize for the inconvenience.</div>'; } } // End of $live IF-ELSE. return true; // So that PHP doesn't try to handle the error, too. } // End of my_error_handler() definition. // Use my error handler: set_error_handler ('my_error_handler'); Link to comment Share on other sites More sharing options...
nomadsoul Posted April 14, 2013 Author Share Posted April 14, 2013 Hi Laurent, Thanks but I can only guess that I didn't have a closing php tag. But I have looked at the entire script and it still escapes me. Link to comment Share on other sites More sharing options...
Antonio Conte Posted April 14, 2013 Share Posted April 14, 2013 Download an IDE with syntax highlighting. It'll show you where your parse error is. These kind of errors are much easier for you to fix on your own. Check out: - Eclipse - Netbeans - PHPStorm (paid) - Etc... 1 Link to comment Share on other sites More sharing options...
Larry Posted April 15, 2013 Share Posted April 15, 2013 For the record, not having a closing PHP tag won't cause an error, certainly not that error. Link to comment Share on other sites More sharing options...
Recommended Posts