Help pre populating forms

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

  1. #1
    I have tried doing this for hours and it is not working. Here is the cut and paste of what I have Done.

    Page Following the first form.

    <?php session_start();
    // store session data
    $_SESSION['Contact0FirstName'] = $_POST['Contact0FirstName'];
    $_SESSION['Contact0FirstName'] = $_POST['Contact0FirstName'];
    $_SESSION['Contact0Company'] = $_POST['Contact0Company'];
    $_SESSION['Contact0Email'] = $_POST['Contact0Email'];
    $_SESSION['Contact0Phone1'] = $_POST['Contact0Phone1'];
    ?>
    This is the url when I hit the submit button:
    http://www.gnsaspecialoffer.com/Home.html?infusion_name=GNSA+Free+Report&infusion_type=CustomFormWeb&infusion_xid=dd14bac19120215d768f050261d922cb&Contact0StreetAddress2=&Contact0StreetAddress1=851+humphrey+st&Contact0PostalCode=97501&Contact0State=or&Contact0Company=higher+vision+marketing&Contact0Email=cgaledrige%40aureliusholdings.com&Contact0LastName=galedrige&Contact0Phone1=5416217046&Submit=Submit&Contact0FirstName=cheyenne&Contact0City=medford&contactId=6

    Here is what I have put on the quote page on page 4 of site:

    <?php session_start();
    //retrieve session data
    $firstname = $_SESSION['Contact0FirstName'];
    $lastname = $_SESSION['Contact0LastName'];
    $company = $_SESSION['Contact0Company'];
    $email = $_SESSION['Contact0Email'];
    $Phone = $_SESSION['Contact0Phone1'];
    ?>

    And here is what is in the form fields:
    <input name="First_Name" type="text" id="First_Name" value="<?php echo $firstname;?>"/>

    When I go to the page <?php echo $firstname;?>"/> is showing in the field.

    Help Please, I don't know what to do.
     
    cgaledrige, Apr 30, 2010 IP
  2. s.ham

    s.ham Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Are you using POST or GET method in <FORM> tag?
     
    s.ham, May 2, 2010 IP