01-18-2001, 03:51 AM
Hey guys... having a little trouble here, and hopefully somebody can shed some light on the problem...
I'm trying to include some vB login info in the header of my new site, which I'm coding in PHP, and I can't seem to get it working correctly.
The script I'm including, basically checks to see if the visitor is logged in, and displays the appropriate template. It's the only vB related code on the page. It worked fine when I was including it into an html page... but when I tried including it into a PHP page, it displayed the follow errors:
Warning: Cannot add header information - headers already sent in /usr/local/etc/httpd/htdocs/forums/global.php on line 705
Warning: Cannot add header information - headers already sent in /usr/local/etc/httpd/htdocs/forums/global.php on line 712
I'm not sure what the problem is, since I'm not very familiar with all of the things global.php does when it's required in a script. Perhaps somebody could help me figure this out? Here's the actual script I'm including:
<?
require("/usr/local/etc/httpd/htdocs/forums/global.php");
if ($bbuserid == 0){
eval( "echo dovars(\"" . gettemplate( "guestloggedin" ) . "\");" );
} else {
if ($bbusername == "" || (isset($bbusername))==0){
$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
eval( "echo dovars(\"" . gettemplate( "userloggedin" ) . "\");" );
} else {
$username = $bbusername;
eval( "echo dovars(\"" . gettemplate( "userloggedin" ) . "\");" );
}
}
?>
Thanks in advance!
-Tom
I'm trying to include some vB login info in the header of my new site, which I'm coding in PHP, and I can't seem to get it working correctly.
The script I'm including, basically checks to see if the visitor is logged in, and displays the appropriate template. It's the only vB related code on the page. It worked fine when I was including it into an html page... but when I tried including it into a PHP page, it displayed the follow errors:
Warning: Cannot add header information - headers already sent in /usr/local/etc/httpd/htdocs/forums/global.php on line 705
Warning: Cannot add header information - headers already sent in /usr/local/etc/httpd/htdocs/forums/global.php on line 712
I'm not sure what the problem is, since I'm not very familiar with all of the things global.php does when it's required in a script. Perhaps somebody could help me figure this out? Here's the actual script I'm including:
<?
require("/usr/local/etc/httpd/htdocs/forums/global.php");
if ($bbuserid == 0){
eval( "echo dovars(\"" . gettemplate( "guestloggedin" ) . "\");" );
} else {
if ($bbusername == "" || (isset($bbusername))==0){
$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
eval( "echo dovars(\"" . gettemplate( "userloggedin" ) . "\");" );
} else {
$username = $bbusername;
eval( "echo dovars(\"" . gettemplate( "userloggedin" ) . "\");" );
}
}
?>
Thanks in advance!
-Tom