How to pass the server side validation messages back to client?
<p>I have the following two script files (i.e., formtest.html and calc.php).
When I do the server side validation on calc.php, how do I pass the error message (i.e. 
        $err_msg back to the formtest.html?</p>

<p>Thank you</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Form Test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;

    &lt;form method="post" action="calc.php"&gt;
    &lt;pre&gt;
          Loan Amount &lt;input type="text" name="principle" /&gt;
                      &lt;input type="submit" /&gt;
    &lt;/pre&gt;
    &lt;/form&gt;
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>

<p>.</p>

<pre><code>// calc.php

        $err_msg = ''; 

        if ( !empty(isset($_POST['principle'])) )
        {
            // process the form and save to DB
        } else {
         $err_msg .= 'Loan Amount is empty!';
        }

        ?&gt;
</code></pre>
