Passing result values from one PHP page to another
<p>I've a form in which I send the values to be calculated to another PHP page which should do the calculation and return the values to this form page. If there is an error, it should return the error to this main page. How would I do that?</p>

<p>This is the basic form page: index.php:</p>

<pre><code>&lt;form id="deps" name="deps" action="calc.php" method="POST"&gt; 
                &lt;div id="er"&gt; &lt;span class="er" &gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;           
                &lt;table class="table"&gt;
                    &lt;tr&gt;
                        &lt;td class="field head"&gt;&amp;nbsp;&lt;/td&gt;
                        &lt;td class="field cv"&gt;&lt;label for="met"&gt;Metric&lt;/label&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td class="field head"&gt;&lt;label for="bd"&gt;Bore Dia.&lt;/label&gt;&lt;/td&gt;
                        &lt;td class="field"&gt;&lt;input type="text" name="bdmm" id="bdmm" /&gt;&lt;label for="bdmm"&gt;MM&lt;/label&gt;&lt;/td&gt;
                        &lt;tr&gt;
                    &lt;td class="field head"&gt;&lt;label for="tw"&gt;Total Weight&lt;/label&gt;&lt;/td&gt;
                    &lt;td class="field"&gt;&lt;input type="text" name="twkg" id="twkg" /&gt; &lt;label for="twkg"&gt;KG&lt;/label&gt;&lt;/td&gt;

                &lt;/tr&gt;
                    &lt;/tr&gt;

                 &lt;/table&gt;   
                        &lt;input type="submit" id="submit" value="Calculate" /&gt;                
              &lt;/form&gt;


         &lt;/div&gt;
</code></pre>

<p>Calc.php</p>

<pre><code>&lt;?php

$bdmm = $_POST['bdmm']; 


if(!$bdmm){ 
          $error = "Please enter a value!";
          echo $error;
     }  
    else {
        echo $bdmm ." success"; 
}
?&gt;
</code></pre>

<p>If there is an error it should display the error in the <code>span</code> tag. And if there is no error and it calculates, it should return the result and display it in the <code>textbox</code>.</p>

<p>Is this possible without Javascript?</p>
