fatal error
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 posted this at 15:55 — 20th June 2002.
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?
ROB posted this at 01:16 — 22nd June 2002.
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.
necrotic posted this at 17:57 — 23rd June 2002.
He has: 296 posts
Joined: May 2002
Well it says the object is Incomplete. Could that change anything?
joyce posted this at 06:39 — 24th June 2002.
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>\";
}
?>
joyce posted this at 06:40 — 24th June 2002.
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>\";
}
?>
ROB posted this at 16:44 — 24th June 2002.
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.