Transferring the POST content from one page to another

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CJ Oxx

    Transferring the POST content from one page to another

    Is there an easy way to transfer a page POST content to the next page?
    Right now I read out the POST content in the PHP script and put it in a
    html form (with POST as content type) as a hidden field, but I am
    wondering if there isn't a nicer solution to do this. I need this
    functionality so that the user is able to re-login if for some reason
    his/her session got lost. This happens every now and then when the user
    is completing a form and hence the need for re-submitting the form data
    after logging in again. The form also contains arrays, so I have to
    iterate through all of them which is okay, but I assume that there is a
    much nicer and cleaner way to do is, I just have not found it yet so I
    need your help.

    Thanks in advance,
    cj.

  • Steve

    #2
    Re: Transferring the POST content from one page to another

    On Mon, 28 Jul 2003 10:11:21 +0200, CJ Oxx wrote:
    [color=blue]
    > Is there an easy way to transfer a page POST content to the next page?[/color]
    [snip]

    If you already have a form that the user is filling in, then hidden form
    fields might still be the best way to go, assuming they don't contain any
    'sensitive' data. Given that your problem seems to be sessions expiring
    while waiting for user response, you might also want to look at storing
    session info in a database, to restart sessions when people log in again.

    Comment

    • CJ Oxx

      #3
      Re: Transferring the POST content from one page to another

      Steve wrote:[color=blue]
      > On Mon, 28 Jul 2003 10:11:21 +0200, CJ Oxx wrote:
      >
      >[color=green]
      >>Is there an easy way to transfer a page POST content to the next page?[/color]
      >
      > [snip]
      >
      > If you already have a form that the user is filling in, then hidden form
      > fields might still be the best way to go, assuming they don't contain any
      > 'sensitive' data. Given that your problem seems to be sessions expiring
      > while waiting for user response, you might also want to look at storing
      > session info in a database, to restart sessions when people log in again.[/color]

      Indeed, there is already a form present in the shape of the login form
      where I can add hidden fields to.

      I am wondering how a custom session handler (by making use of the
      database), can solve my problem. The problem I am experiencing atm is
      that for some users, the session cookie on the server side gets deleted
      after a while (I for one have yet to experience it). I have been able
      to narrow it down to the server side since using SID instead of client
      side server cookies does not have any effect. I have read about
      problems like this happening to other PHP users, but nobody seems to
      have a solution for it (my hosting company uses PHP 4.1.2, so if there
      would be any bugfixes in new PHP versions, I sadly can not make use of it).

      If I would use the db for session management, I will need to create a
      cookie on the user side which identifies the session. However, I would
      like the site to work also in places where cookies are disabled, so I
      would have to come up with a replacement for SID as well I suppose (the
      platform needs to be used in an educational environment where strict
      cookie rules often apply). But if the link between the DB and the end
      user gets broken for some reason, I still need a similar mechanism to
      re-post the POST content, don't I... On the other hand it will be very
      unlikely for this to happen since you are able to control the session
      management better. I do use objects in my sessions (I have written some
      OO form classes which are stored in the session itself) and am a bit
      afraid of possible problems with serialising objects in the DB (just
      because I have never done it).

      Anyway, these are my thoughts on this, I would very much like a response
      on this since I find it a very interesing matter.


      Comment

      Working...