NYCPHP Meetup

NYPHP.org

[nycphp-talk] More questions about working with forms

Ben Sgro ben at projectskyline.com
Thu Dec 13 17:16:12 EST 2007


John,

That's easy to say, but unless your building the app as RESTful or 
something, then the easiest
way to accomplish it IS to store it in a session.

I am not sure what you are trying to do, but maybe you need
hidden form fields to retain state across requests.

Sessions sound easier.



- Ben

John Campbell wrote:
>> Is it as simple as stashing away the object in a hidden field? or
>> maybe in some $_SESSION variable?
>>     
>
> Don't use sessions.   You need to embrace the atomic nature of a web
> request, and just reconstruct the object on each request.  Each
> request should have all of the information required to reconstruct the
> object.  I am not sure what you are trying to do, but maybe you need
> hidden form fields to retain state across requests.
>
> In my opinion, sessions should be used very sparingly.
>
> Regards,
> John Campbell
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
>   



More information about the talk mailing list