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
Re: session question [message #177680 is a reply to message #177665] Fri, 13 April 2012 09:18 Go to previous messageGo to previous message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma:
Senior Member
On Apr 12, 5:43 pm, William Gill <nore...@domain.invalid> wrote:
> 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?

Your form is not recursive. When it is displayed the php script is
completed. The next time it is submitted it is treated as a new
process.
[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: Thu Dec 12 18:30:40 GMT 2024

Total time taken to generate the page: 0.03850 seconds