Re: Passing objects between pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 25 November 2005 20:44, Matt Monaco wrote:
> What is the best way to pass an object between pages?  Currently I am
> first
> serializing, then doing a base64_encode, this doesn't seem entirely
> efficient.  (Especially the encode).
>
> I am however using the encode because I have the serialized object as the
> value of a hidden form element.  I can only have alphanumerics here.
You can instead of using a hidden form element, use sessions.

$_SESSION['obj_state']=serialize(objectinstance)

On other pages you can check if obj_state is set, and use it to reinitialize 
your class (object).

HTH

Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--

Attachment: pgpM0TQdKjGUe.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux