Reply to when to serialize/unserialize

Your name:

Reply:


Posted by sandy on 12/09/96 11:26

With java servlets I can declare complex object-oriented class
structures as session variables in a servlet.
That means I can have a complex HTML form that submits
iteratively back to the server for interim updates, before
a final save (interim post events allow users to add values to dropdown
menus, collapse parts of the form, etc). And it all works
because Java so seamlessly takes care of serializing a complex
class structure for me--you never have to explicitly say
anything about serialize/unserialize in Java servlet programming.
The system does it for you.

So, I've been trying to learn how php sessions work.
I'm new at php sessions. Bear with me.

I defined a simple helloworld test class definition,
that includes a hashed array of test values.
In a test.php, if $REQUEST_METHOD=='GET'
I instantiate an instance of the class, and then
print out a form whose method=='POST'
....inside the GET block I also have
session_start();
$test_class = new TestClass();
session_register('test_class')


So, if $REQUEST_METHOD=='POST'
{
I can say:
$test_class->show();
....and it works. So php must have automatically
serialized the class for me. So why and when
do you ever need to explicitly say something
about serialize($this) or unserialize($that)
....when the system seems to be doing it anyway.

}

--
/* Sandy Pittendrigh >--oO0>
** http://montana-riverboats.com
*/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация