Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How do I create a multi-page order form.

    What I am trying to learn is how to create a multi-page order form. Where whatever is selected from the first page is passed to the next page for confirmation before it is processed by php for email. I know how to create forms and enough php for the only the 1st page to be processed. If you need more of a description just let me know. This is still a learning phase for me.

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    It works the same as a two page process except you have to pass the previous data on to the next. Either with hidden form elements or sessions.

    hidden form approach:
    PHP Code:
    //Somewhere in the form for second page
    foreach($_POST as $key => $value)
    echo 
    '<input type="hidden" name="'.$key.'" value="'.$value.'" />
    '

    Session approach:
    PHP Code:
    <?php
    // At top of script
    session_start();

    foreach(
    $_POST as $key => $value)
    $_SESSION[$key]=$value;
    I think the session method is best.
    Last edited by timgolding; 05-11-2009 at 10:06 PM. Reason: Poor english and grammer
    You can not say you know how to do something, until you can teach it to someone else.

  • #3
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    I would also consider using COOKIES so that if the user fills out half of the form he can come back some other day and not re-enter that data.



    --------------
    Leonard Whistler

  • #4
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Quote Originally Posted by Len Whistler View Post
    I would also consider using COOKIES so that if the user fills out half of the form he can come back some other day and not re-enter that data.



    --------------
    Tis a good idea
    You can not say you know how to do something, until you can teach it to someone else.

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    yeh, sessions are a good way to do it.

    I have shied away from cookies for my apps because some poeple have js switched off and so consistency is lost but, also, if they want to start something, they should finish it. the rewards are good because if they come back a few days later and have a cookie to 'pick up where they left off', whatever they are filling in for, may be gone/sold/booked.

    you need to work out your product/site and know your customers needs, to be sure which way to go.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

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