www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Submitting an html form with php file

  1. #1
    Join Date
    Jun 2008
    Posts
    270

    resolved [RESOLVED] Submitting an html form with php file

    I have an html form that is submitted to a php page and the values of form elements are placed into variables and sent to another page. However, I cannot get it to submit. My onload='document.this.submit();' in the FormAuto is not going to the http://laprotocol.com/xml/ action. Any ideas?

    PHP Page:
    Code:
    <?php
    session_name ('name');
    ini_set ('session.use_cookies', 0);
    session_start();
    
    $_SESSION['i1'] = $_POST["i1"];
    $_SESSION['i2'] = $_POST["i2"];
    $_SESSION['i3'] = $_POST["i3"];
    $_SESSION['i4'] = $_POST["i4"];
    $_SESSION['i5'] = $_POST["i5"];
    $_SESSION['i6'] = $_POST["i6"];
    $_SESSION['i7'] = $_POST["i7"];
    $_SESSION['i8'] = $_POST["i8"];
    $_SESSION['i9'] = $_POST["i9"];
    
    $i1 = $_SESSION['i1'];
    $i2 = $_SESSION['i2'];
    $i3 = $_SESSION['i3'];
    $i4 = $_SESSION['i4'];
    $i5 = $_SESSION['i5'];
    $i6 = $_SESSION['i6'];
    $i7 = $_SESSION['i7'];
    $i8 = $_SESSION['i8'];
    $i9 = $_SESSION['i9'];
    
    echo "
    <form method='post' action='http://laprotocol.com/xml/' name='formAuto' onload='document.this.submit();'>
    <input type='hidden' name='FirstName' value='$i1' />
    <input type='hidden' name='LastName' value='$i2' />
    <input type='hidden' name='Email' value='$i3' />
    <input type='hidden' name='Address' value='$i4' />
    <input type='hidden' name='BirthYear' value='$i5' />
    <input type='hidden' name='AreaCode' value='$i6' />
    <input type='hidden' name='Prefix' value='$i7' />
    <input type='hidden' name='Suffix' value='$i8' />
    <input type='hidden' name='redirectsuccess' value='http://www.mylocaljoblisting.com/redirect.php' />
    </form>
    ";
    ?>
    Last edited by bradleybebad; 08-10-2010 at 08:09 PM.

  2. #2
    Join Date
    Jun 2008
    Posts
    270
    Fixed it:

    Code:
    <?php
    session_name ('name');
    ini_set ('session.use_cookies', 0);
    session_start();
    
    $_SESSION['i1'] = $_POST["i1"];
    $_SESSION['i2'] = $_POST["i2"];
    $_SESSION['i3'] = $_POST["i3"];
    $_SESSION['i4'] = $_POST["i4"];
    $_SESSION['i5'] = $_POST["i5"];
    $_SESSION['i6'] = $_POST["i6"];
    $_SESSION['i7'] = $_POST["i7"];
    $_SESSION['i8'] = $_POST["i8"];
    $_SESSION['i9'] = $_POST["i9"];
    
    $i1 = $_SESSION['i1'];
    $i2 = $_SESSION['i2'];
    $i3 = $_SESSION['i3'];
    $i4 = $_SESSION['i4'];
    $i5 = $_SESSION['i5'];
    $i6 = $_SESSION['i6'];
    $i7 = $_SESSION['i7'];
    $i8 = $_SESSION['i8'];
    $i9 = $_SESSION['i9'];
    
    
    
    echo "
    <html>
    <body onload='document.formAuto.submit();'>
    <form method='post' action='http://laprotocol.com/xml/' name='formAuto'>
    <input type='hidden' name='FirstName' value='$i1' />
    <input type='hidden' name='LastName' value='$i2' />
    <input type='hidden' name='Email' value='$i3' />
    <input type='hidden' name='Address' value='$i4' />
    <input type='hidden' name='BirthYear' value='$i5' />
    <input type='hidden' name='AreaCode' value='$i6' />
    <input type='hidden' name='Prefix' value='$i7' />
    <input type='hidden' name='Suffix' value='$i8' />
    <input type='hidden' name='redirectsuccess' value='http://www.mylocaljoblisting.com/redirect.php' />
    
    </form>
    </body>
    </html>
    ";
    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles