Hello forums !!
i had a problem while creating a objects..
i usually create the objects at the top of the index.php page and all other files are included in the index.php page..
suppose i create a object say :
$obj1 = new MyClass();
while using this object in the another page say cat.php which is included in the index.php.
if(isset($_POST['SUBMIT'])){
global $obj1;
$obj1->save();
}
i had to make the object global, other it doesnt work..inside the functions its obvious to make the varible global in order to use it..but i had to use it in each if() condition.....
Any idea avoid this situation of making global in case of if(), while() etc conditions
Awaiting for your great help
Thanks in advance to all of you