Khatri has asked for the wisdom of the Perl Monks concerning the following question:

I don't want to have mulitple pages on the site, so what I'm doing is writting scripting page which will take you to the next webpage (generated by same script) but problem is how can sore and keep traking the data entered in previous web-page. (because each webpage is taking some input from the end users.)
  • Comment on how to take keep tracking input from the webpage

Replies are listed 'Best First'.
Re: how to manage recursive input on same webpage
by eric256 (Parson) on Sep 19, 2005 at 20:21 UTC

    Not sure I understand completely but it sounds like you could use sessions. The first CGI creates a session and includes the session ID in the form. The next CGI then checks the session and redirects to the begging if there is no session. you could also store a state value in the session itself so that the user can only access the correct script. Each script checks the state and redirects back to the begging or previous script if the state is not correct.


    ___________
    Eric Hodges
Re: how to manage recursive input on same webpage
by CountZero (Bishop) on Sep 19, 2005 at 20:47 UTC
    Sessions is the way to go. Save the current state of the user in a session (don't send it to him) and based upon the state allow him to see the next page (which of course you are dynamically producing, so there is no *real* file to link to). The URL will remain the same, but the value of the state variable will allow you to differentiate.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: how to manage recursive input on same webpage
by Hue-Bond (Priest) on Sep 19, 2005 at 20:04 UTC

    Just use the HTTP referer field of the HTTP headers. It's easily forged, though.

    --
    David Serrano

      while 1 ;) Danae