MyBB Community Forums

Full Version: Error message - Need urgent help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have problem with my forum, today when I access my site I get this error message.

Parse error: syntax error, unexpected '<' in /home/discove3/public_html/inc/plugins/userperms.php on line 210

Yesterday the forum was OK and running without any problems. Can anyone help me?

The url of my forum: http://discovereuropetalk.com/
Moved to the correct forum.
I can see the forum now but it is messed up. There is the following error
Warning: Cannot modify header information - headers already sent by (output started at /home/discove3/public_html/inc/class_core.php:325) in /home/discove3/public_html/inc/functions.php on line 1216

Also can´t login in my Admin CP. Getting this error
Warning: Cannot modify header information - headers already sent by (output started at /home/discove3/public_html/inc/class_core.php:325) in /home/discove3/public_html/admin/global.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home/discove3/public_html/inc/class_core.php:325) in /home/discove3/public_html/admin/global.php on line 95

Would anyone be able to help me here?
Have you edited any of the files with Notepad?
If so, download a new copy of those changed files and change them with a different text editor such as Notepad++ and upload those files. Notepad is a bad, bad editor.
I didn´t edit them at all. That is really strange as yesterday the forum was running perfectly, no errors.
Yesterday I just tried the ad randomizer system plugin from nitemare. I activated it and tried to put a widgetbucks banner, then I deactived the plugin again. However the forum was running fine after that. Today the forum is with the error messages. I don´t understant this.
Please post here the whole section above and under this line (about 10-20 lines):
'public_html/inc/functions.php on line 1216'

Open you file as readable only (if possible) and don't save any changes when closing

I think you have '<br />' outside the php tags where it's shouldn't be.
Hey dvb, here is the code.

 // Versions of PHP prior to 5.2 do not support HttpOnly cookies and IE is buggy when specifying a blank domain so set the cookie manually
$cookie = "Set-Cookie: {$name}=".urlencode($value);
if($expires > 0)
{
$cookie .= "; expires=".gmdate('D, d-M-Y H:i:s \\G\\M\\T', $expires);
}
if(!empty($mybb->settings['cookiepath']))
{
$cookie .= "; path={$mybb->settings['cookiepath']}";
}
if(!empty($mybb->settings['cookiedomain']))
{
$cookie .= "; domain={$mybb->settings['cookiedomain']}";
}
if($httponly == true)
{
$cookie .= "; HttpOnly";
}
header($cookie, false);
}

/**
* Unset a cookie set by MyBB.
*
* @param string The cookie identifier.
*/
function my_unsetcookie($name)
{
global $mybb;
$expires = -3600;
my_setcookie($name, "", $expires);
}

/**
* Get the contents from a serialised cookie array.
*
* @param string The cookie identifier.
* @param int The cookie content id.
* @return array|boolean The cookie id's content array or false when non-existent.
*/

there is this on the line 1216
header($cookie, false);
sorry, I've make a mistake.
please post the lines arround:
public_html/inc/class_core.php - Line 325
dvb, there is nothing in the line 325, just blank line. In the last line 323 is
?>

Here is the whole code
<?php
/**
* MyBB 1.2
* Copyright © 2006 MyBB Group, All Rights Reserved
*
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*
* $Id: class_core.php 3598 2008-01-20 20:42:43Z Tikitiki $
*/

class MyBB {
/**
* The friendly version number of MyBB we're running.
*
* @var string
*/
var $version = "1.2.12";

/**
* The version code of MyBB we're running.
*
* @var integer
*/
var $version_code = 1212;

/**
* The current working directory.
*
* @var string
*/
var $cwd = ".";

/**
* Input variables received from the outer world.
*
* @var array
*/
var $input = array();

/**
* Information about the current user.
*
* @var array
*/
var $user = array();

/**
* Information about the current usergroup.
*
* @var array
*/
var $usergroup = array();

/**
* MyBB settings.
*
* @var array
*/
var $settings = array();

/**
* Whether or not magic quotes are enabled.
*
* @var unknown_type
*/
var $magicquotes = 0;

/**
* MyBB configuration.
*
* @var array
*/
var $config = array();

/**
* The debug information.
*
* @var unknown_type
*/
var $debug;

/**
* The request method that called this page.
*
* @var string.
*/
var $request_method = "";

/**
* Variables that need to be cleaned.
*
* @var array
*/
var $clean_variables = array(
"int" => array("tid", "pid", "uid", "eid", "pmid", "fid", "aid")
);

/**
* Variables that are to be ignored from cleansing proccess
*
* @var array
*/
var $ignore_clean_variables = array();

/**
* Using built in shutdown functionality provided by register_shutdown_function for < PHP 5?
*/
var $use_shutdown = false;

/**
* Constructor of class.
*
* @return MyBB
*/
function MyBB()
{
// Set up MyBB
$protected = array("_GET", "_POST", "_SERVER", "_COOKIE", "_FILES", "_SERVER", "_ENV", "GLOBALS");
foreach($protected as $var)
{
if($_REQUEST[$var] || $_FILES[$var] || $_COOKIE[$var])
{
die("Hacking attempt");
}
}

if(defined("IGNORE_CLEAN_VARS"))
{
if(!is_array(IGNORE_CLEAN_VARS))
{
$this->ignore_clean_variables = array(IGNORE_CLEAN_VARS);
}
else
{
$this->ignore_clean_variables = IGNORE_CLEAN_VARS;
}
}

// Determine Magic Quotes Status
if(get_magic_quotes_gpc())
{
$this->magicquotes = 1;
$this->strip_slashes_array($_POST);
$this->strip_slashes_array($_GET);
$this->strip_slashes_array($_COOKIE);
}
set_magic_quotes_runtime(0);
@ini_set("magic_quotes_gpc", 0);
@ini_set("magic_quotes_runtime", 0);

// Determine input
$this->parse_incoming($_GET);
$this->parse_incoming($_POST);

if($_SERVER['REQUEST_METHOD'] == "POST")
{
$this->request_method = "post";
}
elseif($_SERVER['REQUEST_METHOD'] == "GET")
{
$this->request_method = "get";
}
// If we've got register globals on, then kill them too
if (@ini_get("register_globals") == 1)
{
$this->unset_globals($_POST);
$this->unset_globals($_GET);
$this->unset_globals($_FILES);
$this->unset_globals($_COOKIE);
}
if(isset($this->input['debug']))
{
$this->debug = 1;
}
$this->clean_input();

// Old version of PHP, need to register_shutdown_function
if(phpversion() < '5.0.5')
{
$this->use_shutdown = true;
register_shutdown_function(array(&$this, "__destruct"));
}

if(isset($this->input['intcheck']) && $this->input['intcheck'] == 1)
{
die("MYBB");
}
}

/**
* Parses the incoming variables.
*
* @param array The array of incoming variables.
*/
function parse_incoming($array)
{
if(!is_array($array))
{
return;
}

foreach($array as $key => $val)
{
$this->input[$key] = $val;
}
}

/**
* Strips slashes out of a given array.
*
* @param array The array to strip.
*/
function strip_slashes_array(&$array)
{
foreach($array as $key => $val)
{
if(is_array($array[$key]))
{
$this->strip_slashes_array($array[$key]);
}
else
{
$array[$key] = stripslashes($array[$key]);
}
}
}

/**
* Unsets globals from a specific array.
*
* @param array The array to unset from.
*/
function unset_globals($array)
{
if(!is_array($array))
{
return;
}

foreach(array_keys($array) as $key)
{
unset($GLOBALS[$key]);
global $$key;
unset($$key);
}
}

/**
* Cleans predefined input variables.
*
*/
function clean_input()
{
foreach($this->clean_variables as $type => $variables)
{
foreach($variables as $var)
{
// If this variable is in the ignored array, skip and move to next
if(in_array($var, $this->ignore_clean_variables))
{
continue;
}
if($type == "int" && isset($this->input[$var]) && $this->input[$var] != "lastposter")
{
$this->input[$var] = intval($this->input[$var]);
}
}
}
}

/**
* Logs a message.
*
* @param string The file to log to.
* @param string The message to log.
*/
function log_message($file, $message)
{
$handle = fopen($file, 'a');
fwrite($handle, $message);
fclose($handle);
}

/**
* Triggers a generic error.
*
* @param string The error code.
* @param boolean Halt code execution, true for halt.
*/
function trigger_generic_error($code, $halt=true)
{
switch($code)
{
case "cache_no_write":
$message = "The data cache directory (inc/cache/) needs to exist and be writable by the web server. Change its permissions so that it is writable (777 on Unix based servers).";
break;
case "install_directory":
$message = "The install directory (install/) still exists on your server and is not locked. To access MyBB please either remove this directory or create an empty file in it called 'lock'.";
break;
case "board_not_installed":
$message = "Your board has not yet been installed and configured. Please do so before attempting to browse it.";
break;
default:
$message = "MyBB has experienced an internal error. Please contact the MyBB Group for support. <a href=\"http://www.mybboard.net\">MyBB Website</a>";
}
include MYBB_ROOT."inc/generic_error.php";
if($halt)
{
exit;
}
}

function __destruct()
{
// Run shutdown function
if(function_exists("run_shutdown"))
{
run_shutdown();
}
}
}
?>
so I think that the problem is 'white characters' (space, new line etc.)
delete everything after the '?>' in the last line and save

Don't use MS-notepad since it's problematic with utf8 encoding.
Pages: 1 2