UBB.Dev
Posted By: Moab php script bugs! - 05/25/2005 3:47 AM
this code displays the "welcome username" and "you are not loged in" stuff

<?php
// Require the library
require ("includes/main.inc.php");
include("languages/english/index.php");
// -------------

// ------------------------------
// Define any necessary variables
$Cat = get_input("Cat","get");
// -----------------

// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups, U_TimeOffset, U_FrontPage");
$Username = $user['U_Username'];

$html = new html;
if (!$user['U_Username']) {
//echo ("You are not Loged in. [<a href='http://spokejunkies.com/ubbthreads/login.php?Cat='>Login</a>]");
$html -> not_right ($ubbt_lang['notloggedin']. $ubbt_lang['WEL_PRIV_NO'],$Cat);
}
print ("Welcome ");
print ($Username);
print (". [<a href = 'http://spokejunkies.com/ubbthreads/logout.php?Cat='>Logout</a>]");

?>

i am currently inserting this code into an html page via include and it works great BUT when a user logs out it still shows them as loged in... any ideas?
Posted By: AllenAyres Re: php script bugs! - 05/25/2005 6:15 AM
sounds like a cookie issue
Posted By: Moab Re: php script bugs! - 05/25/2005 7:42 AM
it works ok on the page driven by the ubbthreads index_outside.php page though that’s why i think it has to be a code issue, i didn’t change any of the cookie related stuff... its almost like it isn’t grabbing the updated information from the database... either way i will check out cookies again
Posted By: JoshPet Re: php script bugs! - 05/25/2005 8:36 AM
Is this script inside of your ubbthreads directory?

If not, then a couple of things:
Make sure you set cookies site wide "/" in the config file.

These:
require ("includes/main.inc.php");
include("languages/english/index.php");

May need complete server paths if they aren't inside of the ubbthreads directory. example:
require("/home/youruser/public_html/forums/main.inc.php");
etc...
© UBB.Developers