MyBB Community Forums

Full Version: Integration Errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After I fixed that old login issue, I'm facing some problems with my homepage. You see, I have a "Who's Online" system integrated in the navigation of my site, but I also try to put in the login system. If you were logged in, it would say "Welcome you are logged in".

Now, it returns some errors like this:

Site Wrote:Warning: Cannot modify header information - headers already sent by (output started at /home/admin64/public_html/gmqa/hof.php:6) in /home/admin64/public_html/gmqa/forums/inc/functions.php on line 1121
Be sure that nothing is outputted about your include to global.php, or better yet, make it output at the very end of the file.
That means, don't use echo in your file. use $var = "content here"; when you want to add stuff to it use $var .= "content here";
Then you have echo $var; at the very end of your file.

Moving to Code modifications.

Cheers,
CraKteR.
I have the PHP Parse error fixed, but my login system doesn't tell whether I am logged in or not. Code is:

navigation.php Wrote:<?

define('IN_MYBB',1);

chdir('forums');
require('./global.php');

$loggedin = $space . '<font face="Arial" size="2">Welcome, ' . $mybb->user[username] . '.<br>' . $space . "<font face='Arial' size='2'>You are logged in. <br><br>" .$space. "<form action='member.php' method='post'><input type='hidden' name='action' value='loggout'>
<input type='hidden' name='url' value='http://gmqa.64digits.com/member.php?action=logout' />" .$space. "<input type='submit' class='submit' name='submit' value='Log Out' /></form>";

$loggedout = "<center><font face='Arial' size='2'>You are not logged in. <br><br><center><form action='member.php' method='post'>
<font face='Arial' size='2'>Username: </font><input type='text' name='username' size='15' maxlength='30' /><br />
<font face='Arial' size='2'>Password: </font><input type='password' name='password' size='15' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='http://gmqa.64digits.com/index.php' /><br>
<input type='submit' class='submit' name='submit' value='Login' /></form></center><br>";

if($mybb->user['uid'] != 0)
{
echo $loggedin;
}
else
{
echo $loggedout;
}

?>
You don't need:
mysql_connect('localhost','admin64_gmqa','gamemaker');  
mysql_select_db('admin64_gmqa'); 
mybb will connect for you.
Although - What's the problem? It always shows as loggedout or what?

You should use if($mybb->user['uid'] != 0)
It always shows as LoggedOut. I'll send you info via PM. Wink