Help with passing form fields to another form

Discussion in 'PHP' started by cgaledrige, Apr 29, 2010.

  1. #1
    I have a couple forms on my website. The first form is a contact form that creates a user in infusionsoft. The next form is a personalized quote form that emails me and calculates a quote based on information provided.

    I am trying to find out how to take some of the information from the first form and prepopulate the second form? I put value=’<?=$_GET['FirstName']?>’> in the fields of the first form and it attaches the info to the url. but the next form is not getting the information.

    Can anyone help with this?
     
    cgaledrige, Apr 29, 2010 IP
  2. sevnrock

    sevnrock Peon

    Messages:
    241
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That value string should be in the second form.
     
    sevnrock, Apr 29, 2010 IP
  3. cgaledrige

    cgaledrige Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The second form is not on the next page. It is a fill in form on the first page then goes to the site which has 4 pages. The next form is the quote form on page 4. Can you tell me how to populate the fields from the input of the first form?
     
    cgaledrige, Apr 29, 2010 IP
  4. cgaledrige

    cgaledrige Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The second form is not on the next page. It is a fill in form on the first page then goes to the site which has 4 pages. The next form is the quote form on page 4. Can you tell me how to populate the fields from the input of the first form?
     
    cgaledrige, Apr 29, 2010 IP
  5. sevnrock

    sevnrock Peon

    Messages:
    241
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Oh okay. You can just use SESSION and also, you may want to POST instead of GET

    To grab the info is really easy. On the second page, you'd put
    
    session_start();
    $_SESSION['FirstName'] = $_POST['FirstName'];
    Code (php):
    Then you can grab that data anytime you want. So on the last form, you would just do
    <? php
    session_start();
    $firstname = $_SESSION['FirstName']
    ?>
    <input value = '<?php echo $firstname; ?>' .....
    Code (php):
     
    sevnrock, Apr 29, 2010 IP
  6. cgaledrige

    cgaledrige Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ok so the fields I want to populate are First Name, Last Name, Email, Company Name, and Phone Number. Do I do that for all fields. I have no knowledge in script at all and have been attempting to find things online and piece them together. not working so well.
     
    cgaledrige, Apr 29, 2010 IP
  7. sevnrock

    sevnrock Peon

    Messages:
    241
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yup, you would have to store every input in the session array. Google PHP Session and you should be able to find some easy tutorials
     
    sevnrock, Apr 29, 2010 IP
  8. FriendSwapMeet.com

    FriendSwapMeet.com Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it gets easier you can get sample code from planetsourcecode.com for exactly what you are doing.
     
    FriendSwapMeet.com, Apr 29, 2010 IP