Jump to content
Larry Ullman's Book Forums

Another T Variable Dillema In A Strange Place


Recommended Posts

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

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

 Share

×
×
  • Create New...