SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help - Code is redefined so where did I go wrong?

    What I'm trying to do is receive only data input.
    So where did I go wrong.

    This is the html code.

    Code:
    <form action="order001.php" method="post" style="height: 460px">
    	order01<input id="order01" style="width: 40px" type="text" /> <br />
    	order02<input id="order02" style="width: 40px" type="text" /><br />
    	order03<input id="order03" style="width: 40px" type="text" /><br />
    	<br />
    	<input name="Submit1" type="submit" value="submit" />
    </form>

    This is the php code.

    PHP Code:
    <?php
    $order01 
    $_POST["order01"];
    $order02 $_POST["order02"];
    $order03 $_POST["order03"];

    if ( 
    $order01 ) {
        echo 
    " amount of $order01 <br />";
    }else {
        break;
    }

    if ( 
    $order02 ) {
        echo 
    " amount of $order01 <br />";
    }else {
        break;
    }
    if ( 
    $order03 ) {
        echo 
    " amount of $order01 <br />";
    }else {
        break;
    }


    ?>

    I'm not trying to use any array just yet but if you know how I'm willing to learn.
    Any comments or critique is welcomed.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Your <input> tags are all missing name attributes. The name is what defines the keys for the posted form. The id attribute is only used for targeting elements with JavaScript or CSS.


Bookmarks

Posting Permissions

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