fatal error

They have: 164 posts

Joined: Nov 2001

can anybody tell me wat this error means and how to solve it??

Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition cart of the object you are trying to operate on was loaded _before_ the session was started in c:/inetpub/wwwroot/temppro/show_product.php on line 204

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

Can we see the script?
It appears you are trying to use objects and classes without defining them first.
What is line 204 specifically?

Did you write this or did someone else?

Laughing out loud

They have: 447 posts

Joined: Oct 1999

i believe if that were the case it'd say something along the lines of 'call to a member function of a non-object'...

i may be wrong, but ive never seen that particular error before.

He has: 296 posts

Joined: May 2002

Well it says the object is Incomplete. Could that change anything?

They have: 164 posts

Joined: Nov 2001

this is the code..

<?php
if ($CPSESSION[\"cart\"]->itemcount() != 0) {
        echo \"<p>\";
        echo \"<center>\";
        echo \"<input type=\\"
button\\" value=\\"View Shopping Cart\\" onclick=\\"javascript:location.replace('view_cart.php?cat=$category')\\">\";
        echo \"</center>\";
        echo \"<p>\";
    }
?>

They have: 164 posts

Joined: Nov 2001

someone else write this script. everything works fine when running on his computer but when come to mine, i got this fatal error.

this is the code..

<?php
if ($CPSESSION[\"cart\"]->itemcount() != 0) {
        echo \"<p>\";
        echo \"<center>\";
        echo \"<input type=\\"
button\\" value=\\"View Shopping Cart\\" onclick=\\"javascript:location.replace('view_cart.php?cat=$category')\\">\";
        echo \"</center>\";
        echo \"<p>\";
    }
?>

They have: 447 posts

Joined: Oct 1999

<?php
if ($CPSESSION[\"cart\"]->itemcount() != 0)
?>

is itemcount a method or a property? it appears to be a property, however you're accessing it as a method.

try

<?php
if ($CPSESSION[\"cart\"]->itemcount != 0)
?>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.