Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2001
    Posts
    193

    Making A Form Span Across Multiple Pages

    I have a form that I put together in PHP and it is VERY long so I have to break it up into two or three pages. Can somebody tell me how I can make it so it will do this? I added an error checking section that will validate the data in PHP. I would like it to validate the data and if it is OK, it will go to the next page of the form. On the first page of the form, the visitor has to enter a username/password so i don't think the hidden form value option will work.

    Any advice would be greatly appreciated.


    Regards,

    JTM

  2. #2
    Join Date
    Mar 2002
    Posts
    376
    Well, Im sure someone could help you better than me but since nobody is posting... To have the information in the following pages, I think you need to use a query string. If you look at the URL in your browser Im sure you will see what im talking about like: .php?s=&action=newreply&threadid=75158. Then all you will have to do is make a script to process all the data and the end. Or maybe you could make some kinda cookie like program. Sorry Im a new PHP coder =0
    "The impossibility of conceiving that this grand and wonderous universe with our conscious selves arose through chance, seems to me the chief argument for existence of God; but whether this argument is of real value I have never been able to decide... The safest conclusion seems to be that the whole subject is beyond the scope of man's intellect." - Charles Darwin

  3. #3
    Join Date
    Mar 2002
    Posts
    376
    btw it shouldnt process secure info, but i dont think pw's will be a problem just not like credit card info or nothing idiotic like that
    "The impossibility of conceiving that this grand and wonderous universe with our conscious selves arose through chance, seems to me the chief argument for existence of God; but whether this argument is of real value I have never been able to decide... The safest conclusion seems to be that the whole subject is beyond the scope of man's intellect." - Charles Darwin

  4. #4
    Join Date
    Oct 2001
    Posts
    193
    I thought about that but since the visitor would be submitting their username/password it wouldn't be secure, correct? If this is correct, is there some other way to do this?

    JTM

  5. #5
    Join Date
    Mar 2002
    Posts
    376
    Yes, there are other ways doing it. I'll have to look though... I cant seem to find the page I used to do all this...
    "The impossibility of conceiving that this grand and wonderous universe with our conscious selves arose through chance, seems to me the chief argument for existence of God; but whether this argument is of real value I have never been able to decide... The safest conclusion seems to be that the whole subject is beyond the scope of man's intellect." - Charles Darwin

  6. #6
    Join Date
    Jun 2001
    Location
    North Carolina, USA
    Posts
    363
    This link is your best friend: PHP Manual

    IMO, you're best option is using a php sessions.

    About security: If you're serious about keeping this username/password a secret, you'll want to load at least that first submit to a https:// form. That is the only, I repeat, only way to even pretend you're you're keeping it private.

    What you do with it once you get it, is a better question... I would say look in to the mcrypt and hash functions of PHP. If you store the password in plain text anywhere, it's a candidate for hijacking. It could be captured by a black-hat(or more likely, a script kiddie) and used against you, or your user.
    I am now Tobarja.

  7. #7
    You could pass the info in a URL

    At each script have this:

    PHP Code:
    <form method='POST' action='form2.php?info1=".$info1."&info2=".$info2."'
    And so on.

    But you could also pass it to sessions and then the users couldn't see the info in the address bar.
    www.atlanticrail.com

  8. #8
    Join Date
    Oct 2001
    Posts
    193
    Could you please give me an example of how I could do this with sessions? I'm new to using PHP.


    JTM

  9. #9

    sessions

    If you want to use sessions you could use the session id as a unique field in a database where you store the information temporarily until the last page of the form is processed. You then grab the info from the database and process it all.

    IMO, this would be the best solution for you.

    Edit: For the password, the best is to use md5. This means no-one can pull passwords from where you store them. Only problem is, you can't retrieve it either if the user has lost his/her password.
    Nico V.
    KazaaSkins.Com - Now online!

  10. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

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