$_POST with multiple values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • majuowra
    Private

    • Nov 2008
    • 2

    $_POST with multiple values

    Am a .NET programmer coming over to PHP, and I know this is a silly question, but I can't get it to work:

    -----------------------------------------------------

    // Subscription Form
    <div>
    <form action="CheckEmail.php" method="post">
    First Name: <input type="text" name="FirstName" /><br>
    Last Name: <input type="text" name="LastName" /><br>
    Email Address: <input type="text" name="EmailAddress" />
    <input type="submit" value="Submit" />
    </form>
    </div>

    // Output Page
    <?php
    $FirstName = $_POST['FirstName'];
    $LastName = $_POST['LastName'];
    $EmailAddress = $_POST['EmailAddress'];

    echo $FirstName;
    echo $LastName;
    echo $EmailAddress;
    ?>

    -----------------------------------------------------

    All that shows up on the Output page is $EmailAddress... the first two are blank. What's going on here?

    Thanks.
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: $_POST not working with multiple values

    A link please ? The code seems correct...

    What are the slashes in the form code for ?

    To debug, place the following code in your output page:

    <?php
    print_r($_POST);
    $FirstName = $_POST['FirstName'];
    $LastName = $_POST['LastName'];
    $EmailAddress = $_POST['EmailAddress'];

    echo $FirstName;
    echo $LastName;
    echo $EmailAddress;
    ?>

    the print_r command should display all the keys and values of the $_POST array, so you can debug.

    However, i reproduced your form and CheckEmail.php files and they DO work: http://www.dbtechnosystems.com/post/...mail_form.html
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • majuowra
      Private

      • Nov 2008
      • 2

      #3
      Re: $_POST not working with multiple values

      Thank you for your quick response!
      Okay, so I plugged away at it, and it appears that my problem lies in two places:

      1) Microsoft Expression Web 2, which has great support for PHP, but doesn't want to do this, and gives me an error (I will follow up with the error message shortly...)
      2) Adobe Dreamweaver CS3, which wasn't setup to synchronize my files.

      Once I synchronized my local and server-side files on Dw I was fine. However I really prefer the Expression Web environment as I come from the VS IDE (which doens't have native support for PHP yet :), and haven't been able to figure it out yet.

      Thanks again, you guys rock!

      Comment

      Working...
      X