SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's the best way to span a form accross multiple pages?

    I'm creating a form, that will allow people to enter data, click on next, enter more data, confirm, and finally add to database.

    What's the best method in creating a form that uses multiple pages? Sessions? Hidden Fields, or others?

  2. #2
    SitePoint Enthusiast Scripting X's Avatar
    Join Date
    May 2001
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I would use...

    There are a few ways this can be achieved, the first is to simply pass the info pass the pages e.g. post.php?name=chris&password=38739843, secondly, using cookies and third using sessions.

    I would use sessions as they are the most secure.
    cgi://www.scriptingx.com - Everything CGI

  3. #3
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    defintly sessions... say u have this text as a form entry

    " my name is bob & my friends name is bobby"

    in the querystring, it would screw up because of the &
    also if u have have some qoutes..stuff like that.. its probaly eassier to store them in a session

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The querystring can be encoded using rawurlencode() actually, but it could get too long...and it's sort of ugly anyway. Sessions might work, but then again, they might be overkill. If the form is relatively simple, it may be easier to just use cookies, or some hidden form fields. Heck, I'd try 'em all for the sake of experience, and go with whichever works best.

  5. #5
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd use hidden form fields. They'll work on any browser whether or not cookies are enabled and they were pretty much designed for the problem you are describing


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •