
June 6th, 2000, 04:30 PM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
1) yes i am using PHP4
2) The SIMPLE version of the code is as follows:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
//class.inc
class user{
var $user_connection;
var $username;
var $fullname;
var $perms;
function user(){
/* establishes all connections and initializes the class */
}
function verify_user(){
//just stuff that verifies the user
}
function log_user($action = 'null'){
//log a user
}
} [/quote]
Then on my index.php page:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
session_start();
if (!isset($session)){
$session = new user();
$session->verify_user();
session_register("session");
}
$session->log_user("Action is bla");
[/quote]
That works. As you can see I store the session, and i recall it on another page and the session is there. Here is the code for the page:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
session_start();
if (!isset($session))
{
echo "Error: You are not logged in!";
exit();
}
else
require('class_admin.inc'); //thats the name of the script, still get hte same message with or without it.
<?
echo session->fullname; //this line works
$session->log_user("Action is bnl"); //this line doesnt
[/quote]
Please get back to me, this is important thank you!
|