FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » session question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
session question [message #177665] Thu, 12 April 2012 16:43 Go to previous message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma:
Member
I have a site with an input form that recursively calls itself via
action="<?php echo $_SERVER['PHP_SELF']; ?>", and a couple links with
url encoded data that indicate simple selections w/o using a form. It
uses different include('file'); statements based on the progress and/or
choices previously made, and it works fine, but is a little complicated
to track "state" when troubleshooting, updating, or changing.

I am thinking of using a session approach which would be simpler to
follow, but have never used sessions on a page that is recursively called.

First since session_start() would be called every iteration, that will
cause an error unless I encapsulate it in an if loop to see if the
session already exists. Is this the preferred method?

Second, when the user is finished and receives an acknowledgement I plan
to call a session_unset() to clear things up so that if they want to do
it again, they are beginning with a clean slate. Again, is this the
preferred method?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Date/Time warning
Next Topic: How to create an instance from a class name
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 11:17:54 GMT 2024

Total time taken to generate the page: 0.05248 seconds