Re: [PHP] passing objects in url

2002-07-09 Thread Marek Kilimajer

This won't work, you must register it within a session, just remember to 
declare the class befor session_start()

Alexander Ross wrote:

If $this is an object, can I have the following link?

a href=process_this.php?this=$thisProcess/a

Will the URL become too long?  Will teh info get passed correctly? thanks

Alexander Ross




  




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing objects in url

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Alexander Ross wrote:
 If $this is an object, can I have the following link?
 
 a href=process_this.php?this=$thisProcess/a
 
 Will the URL become too long?  Will teh info get passed correctly? thanks
 

99% you are right, it will definitely be too long for a GET. Besides, 
before writing the process_this.php?this=$this thing your *$this* should 
be serialized. Watch the docs for it.

Most probably you have access to some database, so you can just save 
your serialized version to a table (the type depends on the size of your 
serialized object) and just pass a pointer to the row for the process 
script to retrieve and unserialize the object back to normal life.

Just one more thing: if your object contains any reference they will 
definitely become invalid, methinks. And I would never do object 
serializing if I expected performance to be there. But this really 
depends on the nature of your object, so handle the suggestion with 
care, it's just way too generic.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing objects in url

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Marek Kilimajer wrote:
 This won't work, you must register it within a session, just remember to 
 declare the class befor session_start()

This can be pretty risky if your object contains references to external 
objects. Works okay for insulated instances, though. Yet I would suggest 
not trusting sessions with objects.

You never know how your class is going to evolve on time and you never 
know how sessions are going to evolve on time either (just think of the 
register globals thingy).

I'd rather map object attributes to a good old table of mine and be sure 
I can build it back whenever I want to, no matter what surprises lie 
ahead on technology boulevard. Well, almost sure :)

ÐÏËÁ
áÌØÂÅÒÔÏ


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php