Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    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
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    What do you mean by data input? all input is data, no?
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    PHP Code:
    <?php
    if(isset($_POST['Submit1']))
    {
        if ( isset(
    $_POST["order01"]) && !empty($_POST["order01"]) )
            echo 
    " amount of ".$_POST["order01"]." <br />";
        else
            die(
    "insert order 01");
        
        
        if ( isset(
    $_POST["order02"]) && !empty($_POST["order02"]) )
            echo 
    " amount of ".$_POST["order02"]." <br />";
        else
            die(
    "insert order 02");
            
        if ( isset(
    $_POST["order03"]) && !empty($_POST["order03"]) )
            echo 
    " amount of ".$_POST["order03"]." <br />";
        else
            die(
    "insert order 03");        
    }
    ?>
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #4
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    break; is mainly used for stopping a loop
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 


  •  

    Posting Permissions

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