MyBB Community Forums

Full Version: Wierd Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
What I mean is that you need to have the code something like this:

<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

include('your_forum_directory/global.php'); // this comes first

include('header.php'); // this comes always AFTER (anywhere after)


If you're still having problems please post the whole code file here, and also post header.php. Then it will be easier to debug.

Warptweet Wrote:...sessions and connections must be created before any output, even before HTML. Although, I ahve never come across such a coding problem such as this.
Actually that's not true with PHP.
Meh...

Quote:Warning: main(./inc/init.php) [function.main]: failed to open stream: No such file or directory in /home/warp/public_html/warp/global.php on line 13

Fatal error: main() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/warp/public_html/warp/global.php on line 13
Looks like your missing some files.
Warptweet Wrote:Meh...

Quote:Warning: main(./inc/init.php) [function.main]: failed to open stream: No such file or directory in /home/warp/public_html/warp/global.php on line 13

Fatal error: main() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/warp/public_html/warp/global.php on line 13

i had a similar problem, in global.php replace line 13 with
require_once "/home/warp/public_html/warp/inc/init.php";
I posted another sample code here: http://ideas.mybboard.net/idea/forum-dir...ntegration

Try using chdir before the include to global.php.
Just add dirname(___FILE___). before "./inc/init.php"; And remove the . before /. Within global.php
So final line would look like:
require_once dirname(___FILE___)."/inc/init.php";

Should work.
...It doesn't work.

Does anyone here who HAS a working version of MyBBoard that 100% sure connects from a different directory? Or does anyone know a small sample code that they can spare from the mybboard.net website that they use for their integration?
whats the error?
Theres no error.

http://www.warptweet.com/testing.php

It says "Welcome Guest!" even when I'm logged in.
When i'm not logged in, I haven't tried yet, but I presume it will just say "Welcome, Guest!" again.

Oh, and since your guys codes didn't work, I used this code to get what http://www.warptweet.com/testing.php currently shows.

Quote:<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

chdir('warp/');
include('global.php');

if($mybb->user['uid'] > 0)
{
echo $mybb->user['uid'];
}
else
{
echo "Welcome Guest";
}
?>
For debugging purposes can you try this:

<?php
error_reporting(E_ALL);
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

chdir('warp');
require('global.php');

if($mybb->user['uid'] > 0)
{
echo $mybb->user['uid'];
}
else
{
echo "Welcome Guest";
}
?>
Pages: 1 2 3