Unknown(): The script tried to execute a method or.. URGENT
Posted: Tue Nov 18, 2003 11:51 pm
Hai all
am new to PHP
i created a 2 classes
1 Items
1 ShoppingCart
user selects item and item object will have info of it. Am chencking wheather session 'cart' is null else creaing of shoppingcart object. using a function am adding the items to shopping cart am calling session_start() in all pages, i assigne session.auto_start to 0. i had written
if (!isset($_SESSION['Cart']))
{
echo "CART EMPTY <br>";
$_SESSION['Cart'] = new ShoppingCart();
}
when adding to session am using
$_SESSION['Cart']->addtocart($item);
but am getting a fatal error
Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>shoppingcart</b> of the object you are trying to operate on was loaded _before_ the session was started in C:\Program Files\Apache Group\Apache2\htdocs\mybenz\shoppingcart.php on line 29
please tell me why am getting this errror
its urgent pls help me
am new to PHP
i created a 2 classes
1 Items
1 ShoppingCart
user selects item and item object will have info of it. Am chencking wheather session 'cart' is null else creaing of shoppingcart object. using a function am adding the items to shopping cart am calling session_start() in all pages, i assigne session.auto_start to 0. i had written
if (!isset($_SESSION['Cart']))
{
echo "CART EMPTY <br>";
$_SESSION['Cart'] = new ShoppingCart();
}
when adding to session am using
$_SESSION['Cart']->addtocart($item);
but am getting a fatal error
Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>shoppingcart</b> of the object you are trying to operate on was loaded _before_ the session was started in C:\Program Files\Apache Group\Apache2\htdocs\mybenz\shoppingcart.php on line 29
please tell me why am getting this errror
its urgent pls help me