PDA

View Full Version : $bbuserinfo['userid'] ... question....


cat_san
03-02-2005, 12:59 PM
i have a front section to my site - the forums are a subdirectory - as in
mysite.com
______|______index.php , welcome.php
|___ forums
|___ index.php, login.php, etc (the forums)

if i login at index.php, i've changed things ($url) to redirect to "../welcome.php"

now i was using session_start() on each page - maintaining a session thru my site... however, i don't want a separate login just for the forums ---
i've tried accessing $bbuserinfo['userid'] in my welcome.php file - but it keeps coming up blank --- can anyone tell me what i'm doing wrong with the following code?
( it keeps hitting the ELSE... do i need to import something from vbulletin to actually SEE bbuserinfo? )

<?php
session_start();
require('./imports/levelOneImports.php');
require('./imports/footer.php');
$username = $_SESSION['username'];
$location= $_SESSION['location'];

if ($bbuserinfo[userid])
{ $_SESSION['userid'] = $bbuserinfo['userid'];
$_SESSION['username'] = $bbuserinfo['username'];
$_SESSION['location'] = "Welcome";
$username = $_SESSION['username'];
$location= $_SESSION['location'];
echo("BBUSERID: " + $bbuserinfo['userid']);
}
else
{
printHeader($username, $location );
}

Zero Tolerance
03-02-2005, 01:03 PM
In your php, stick this before you begin to use $bbuserinfo:
require_once("global.php");

:)

- Zero Tolerance