1 Replies - 234 Views - Last Post: 06 January 2013 - 03:04 PM Rate Topic: -----

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

cant print value of post

Posted 06 January 2013 - 03:00 PM

inside div dialog01 i want to echo $ss. but its echo out "no POST". i am not sure how can i echo the value of qty.

index.php
    <?php
    echo"
    <form  method='POST' action='index.php'>

       <input type='text'  name='qty' />

        <button type='submit' id='opener01'  name='b1'>submit</button>

    </form>";

 echo"
<div id='dialog01' title='ccc'> ";
       if(isset($_POST['qty'])){        
               $ss = $_POST['qty'];
                echo $ss;
                }
                else
                {
                echo"NO POST";
               }

    echo"
    </div>";
    ?>


jquery.js
$( "#dialog01" ).dialog({
    autoOpen: false, 
    modal: true,
    buttons: {
        "option1": function() {
            $( this ).dialog( "close" );
         },
        "exit": function() {
            $( this ).dialog( "close" );
        }
    }
});
$( "#opener01" ).click(function() {
      $( "#dialog01" ).dialog( "open" );
      return false;
}); 



Is This A Good Question/Topic? 0
  • +

Replies To: cant print value of post

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2881
  • View blog
  • Posts: 9,954
  • Joined: 08-August 08

Re: cant print value of post

Posted 06 January 2013 - 03:04 PM

The problem is that you're not recognizing the difference between client and server code. Memorize the order in which things occur:
  • Client takes an action
  • Browser sends request to server.
  • Server runs PHP script.
  • Server sends HTML/PHP output to the browser.
  • Browser renders the page.
  • Go to step 1.

Now apply this to your code and you'll see why it isn't working.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1