Mailinglisten-Archive |
> 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 d:\htdocs\test\sm\htdocs\sess.php on line 7 > > Was läuft da falsch??? > > Der Code dazu ist denkbar einfach; > > sess.php > -------- > > require ('classtest.inc'); > > if (!is_object($CART)) { #echo "NEW OBJEKT!"; > $CART = new cart; > session_register('CART'); > } > > $CART->add(10,5); > > echo 'CARTCONTENT: <br>'; > > foreach ( $CART->cart as $k => $v ) { > > echo 'ID: '.$k.' - NUM: '.$v['num'].'<br>'; > > } > > echo '<a href="sess.php">AGAIN</a>'; Wo kommt denn das session_start()? Das Include der Klassen-Datei unbedingt VOR diesem Aufruf gemacht werden. Gruß Jan
php::bar PHP Wiki - Listenarchive