This is not a workaround[tm] but the way it works. You *have* to define your class before you access it; the same is true for session_start().
- Markus On Tue, Oct 30, 2001 at 12:17:09PM -0000, [EMAIL PROTECTED] wrote : > From: [EMAIL PROTECTED] > Operating system: Linux Red-Hat 7.1 > PHP version: 4.0.6 > PHP Bug Type: Session related > Bug description: Object are not correctly serialized > > This bug made me searching 4 days... > > First take a class definition in a file called "testclass.php": > > class test{ > var $attribut; > } > > -------------------------------------------------- > Then make a "main.php" who contains : > > session_start(); > > //HTML header > echo "<html>"; > > //Define frames > echo '<frameset rows="80,*" border='.$bord_horz_size.' frameborder="yes" > bordercolor='.$col_bord_horz.'>'; > > echo '<frame name="status-frame" noresize scrolling="no" > src="/status_gen/status_gen.php">'; > > echo '<frameset cols="250,*" border='.$bord_vert_size.' frameborder="yes" > bordercolor='.$col_bord_vert.'>'; > > echo '<frame name="menu-frame" noresize scrolling="no" > src="/menu_gen/menu_gen.php">'; > > //THE main frame : > echo '<frame name="main-frame" noresize > src="/mainframe/mainframe.php">'; > > //End of the frames > echo "</frameset>"; > echo "</frameset>"; > > //End of HTML > echo "</html>"; > ----------------------------------------- > > Now we define the "mainframe.php" : > > require("test.php"); > > --------------------------------------- > Let's define "test.php" : > > require_once("testclass.php"); > if (!isset($dummy)){ > $dummy = new testclass(); > $dummy->attribut = "foo bar"; > session_register("dummy"); > } > else{ > echo $dummy->attribut; > } > > --------------------------------------- > When I refresh the mainframe it says : > "fatal error : The script tried to execute a method or access a property of > an incomplete object. Please ensure that class definition (...). > > The bug report #13298 give a walk arround : > include the class definition before the session_start but I can't do it > beceause I've to start my session in the frame-definition-page. > > I've to make an important presentation of our project in a few days and > this problem is causing to me a lot of trouble... > I need some help! > > Thx a lot! > -- > Edit bug report at: http://bugs.php.net/?id=13869&edit=1 > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend- -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]