View Full Version : info about session table
ghiboz
03-13-2007, 01:07 PM
hi all!
I'm trying to develop a little cms based on vbulletin... I wish know how can I do to insert a user in the session table...
example..
the user enter in the home of the forum and automatically appears a record in the table...
but if the user go on my main page doesn't appear in session...
how can I do this?:rolleyes:
thanks
Marco van Herwaarden
03-13-2007, 02:55 PM
Just include global.php in your script and a session will be done automatically.
ghiboz
03-13-2007, 03:12 PM
Just include global.php in your script and a session will be done automatically.
thanks! but
require("./includes/config.php");
require("./global.php");
I use these, and works, 'cause i tried to comment the second line and the message that appears is this:
Fatal error: Call to a member function on a non-object in /home/admin/domains/test/public_html/forum/includes/functions_user.php on line 263
I suppose that the path is correct and global.php is included, but the session doesn't appears valid
thanks again:up:
JMH11788
03-21-2007, 12:49 AM
thanks! but
require("./includes/config.php");
require("./global.php");
I use these, and works, 'cause i tried to comment the second line and the message that appears is this:
Fatal error: Call to a member function on a non-object in /home/admin/domains/test/public_html/forum/includes/functions_user.php on line 263
I suppose that the path is correct and global.php is included, but the session doesn't appears valid
thanks again:up:
I've been trying to get past this for months. Someone please help him (us) :(
Just to add to the information pool, I also get this error sometimes when trying to do the same thing:
warning: array_keys(): The first argument should be an array in /var/www/forums/includes/functions.php on line 3699.
warning: Invalid argument supplied for foreach() in /var/www/forums/includes/functions.php on line 3699.
Dismounted
03-21-2007, 08:47 AM
require("./global.php");
Just that is sufficient. The config is loaded by global.php.
JMH11788
03-21-2007, 01:07 PM
require("./global.php");
Just that is sufficient. The config is loaded by global.php.
right, but why does it not work then?
I've noticed it usually works okay if your file is in the same directory as vBulletin, but if you aren't in the same directory then problems arise quickly. A fix is to use chdir() to set the right working directory before including the file. It works all fine and dandy until I try to add all of it into a function (my CMS uses functions for nearly everything so it has to go in a function). I've been pulling my hair out trying to make it work.
I'm going to try including the login file with an include via http. I'll declare the username and password variables global so they are available outside of the scope. HOPEFULLY that will work, but at this point it seems to be wishful thinking :(
kkiely
03-28-2007, 11:56 PM
I use
<?php
chdir("vbforum/");
require('./global.php');
chdir("../");
?>
and it works fine
JMH11788
03-29-2007, 02:04 AM
I use
<?php
chdir("vbforum/");
require('./global.php');
chdir("../");
?>
and it works fine
I use
<?php
$cwd = getcwd();
chdir('/var/www/forums');
require_once('./global.php');
chdir($cwd);
?>
and it works sometimes and not others. I've been dissecting the code more and have learned what causes the error. It all depends on what you are trying to do though, but I got it down pat pretty well.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.