Q:

Why when clicking a button which is created after another button is clicked is being removed using PHP?

I want to have a button (button1)  if it is clicked I want to display another button (button2)
and if button2 is clicked I want to display something else , it is working fine  but button2 is removed  after is clicked  , is button1 being unset when button2 is clicked ? How can I make it stay still but I want it to appear only after button1 is clicked
Here is an example code :
<body>
    <form action="" method="POST">
     <input type="submit" name='submit' value='1'  >
    </form>

    <?php
      if(isset($_POST['submit']))
      {
          echo "
           <form action='' method='POST'>
     <input type='submit' name='submit2' value='2'  >
    </form>
          ";
      }
    ?>

     <?php
      if(isset($_POST['submit2']))
      {
          echo "
           <form action='' method='POST'>
     <input type='submit' name='submit3' value='3' >
    </form>
          ";
      }
    ?>
</body>

A:

When you click button 1, you submit a form. In the request is all the data from that form. i.e. submit=1.
When you click button 2, you submit a different form. In that request is all the data from that form. i.e. submit2=2.
The second request is entirely independent of the first request.
The data from the first form is not included in the second request because you never do anything to make it persist. 
You could:

Write your server-side logic to assume that form 1 was submitted if it gets a submission with submit2=2 in it
Include a hidden input in form 1 that includes the data from form 1
Store the data in a session and look in $_SESSION as well as $_POST.

