I have a simple class file simple.php
Code: Select all
<?php
class simple{
function dummy(){
print "TEST SUCCESSFUL!\n";
}
}
?>// test1.php
Code: Select all
<?php
require ("simple.php");
session_start();
$CLSOBJ=new simple();
session_register("CLASSOBJ");
$CLASSOBJ=$CLSOBJ;
print isSet($_SESSION['CLASSOBJ']);
$CLASSOBJ->dummy();
?>In the other .php files I have added the following lines:
Eg:// test2.php
Code: Select all
<?php
require("simple.php");
session_start();
print isSet($_SESSION['CLASSOBJ']);
$CLASSOBJ->dummy();
?>'print isSet($_SESSION['CLASSOBJ']);'
but a fatal error like 'Call to a member function on a non-object in' is coming for '$CLASSOBJ->dummy();' . Any idea?Or any alternate method to this?Pls help....
Hawleyjr: Please Use PHP Tags
viewtopic.php?t=21171