Handling echo messages with multiple forms in PHP
<p>Hi I've got my code similar to the following structure. </p>

<p>To put it in a simpler way, when I type some thing ('Hello World') on the text box and hit <code>One</code> it gives me an output as per what I've typed along with the message <code>form two is here!</code> and also the <code>TapMe</code> button. </p>

<p>Now secondarily (where the issue is) if I click the <code>TapMe</code> button the original text box output ('Hello Word') disappears. I need to keep it without loosing it on the screen!</p>

<p>Any suggestions? Thank you!</p>

<pre><code>&lt;DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id="one" style="width:300px; background:gray;"&gt;
            &lt;form method="post" action="#"&gt;
                &lt;input type="text" name="txt1" id="txt1"&gt;
                &lt;input type="submit" name="sendtwo" id="sendtwo" value="One"&gt;

            &lt;/form&gt;
        &lt;/div&gt;

        &lt;div id="two" style="width:300px; background:yellow;"&gt;
            &lt;?php
            if(isset($_POST['sendtwo']))
            {   if($_POST['txt1'] == '')
                {echo 'txt1 is empty!'; return;} else {echo $_POST['txt1'];}
            }
            if(isset($_POST['sendt']) || isset($_POST['sendtwo']))
            {echo "&lt;table border='1'&gt;&lt;tr&gt;&lt;td&gt;form 2 is here!&lt;/rd&gt;&lt;/tr&gt;"; 
            ?&gt;
            &lt;form method="post" action="#"&gt;
                &lt;?php echo "&lt;tr&gt;&lt;td&gt;&lt;input type='submit' name='sendt' id='sendt' value='TapMe'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";}
                if(isset($_POST['sendt'])) {echo "You hit TapMe"; return;}
                ?&gt;
            &lt;/form&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
