Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
nomadsoul

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
 

Share this post


Link to post
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');

Share this post


Link to post
Share on other sites

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...

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...