Thread: New approach
View Single Post
Old 05-05-2008, 04:47 PM   #3 (permalink)
Evulness
The Contributor
 
Evulness's Avatar
 
Join Date: Apr 2008
Location: Tampa, FL
Posts: 65
Thanks: 6
Evulness is on a distinguished road
Default

hmm, heres a question for you, because i can't seem to get the results i want...
how would i do the following...

-mysql.class
--user.class extends mysql.class
-session.class

how can i make my session.class work inside my user.class?
or to put it another way. How can i use my session.class objects in objects inside my user.class, if i can only extend once.

like i have my user.class set to do login stuff, but when that login function is used, i want to be able to use my session.class at the same time and set the sessions that way..... can i do this how i want? or should i not use a class in this mannor, just include, and use both classes in a "Login" script through normal means.
because at the moment, the latter sounds easier.

with my session class, i can:
Code:
include_once ('evulsess.php');
$session = new EvulSession();

$session->set_var($key, $value); //same as $_SESSION['$key']=$value;
$session->get_var($key);//returns $value
$session->unset_var($key);
$session->DestroySession('Hacking attempt!');
$session->show(); //returns $key : $Value of ALL session variables for debugging
and 
$session->validate();
//checks if usr_name is set, if it is, then it checks IP, then checks user agent, then
//checks time. if any are false, script die()'s, else if no errors returns $session->set_var('Is_Valid', true);
its a nice class, but... i wanna be able to $session->set_var(); inside my already extended user.class

any ideas?
would i need to use call_user_func(), or call_user_func_array() ? if so how would i do this?

__________________
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
Send a message via AIM to Evulness
Evulness is offline  
Reply With Quote