Error Placing on same page PHP
<p>some of my code in addUser.php it pure html
addUser.php</p>

<pre><code>&lt;form action="process/addNewUser.php" method="POST" id="userForm"&gt;
&lt;table width="79%" border="0" cellspacing="6" cellpadding="1"
    class="tabcont"&gt;
    &lt;tr&gt;
        &lt;td width="47%" align="right"&gt;Title:&lt;/td&gt;
        &lt;td width="53%"&gt;
            &lt;select name="title"&gt;&lt;option value='0'&gt;- - select - -&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td width="47%" align="right"&gt;
        First Name:&lt;/td&gt;
        &lt;td width="53%"&gt;&lt;input type="text" id="firstname" name="firstName" class="required" /&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
        &lt;td align="right"&gt;Middle Name:&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" id="middlename" name="middleName" class="name" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td align="right"&gt;Password:&lt;/td&gt;
        &lt;td&gt;&lt;input name="password" value="" readonly="readonly"
            id="password" class="required" " /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td align="right" colspan="2"&gt;
            &lt;input name="addNewUser" type="submit" class="submit" id="submit" value="Submit" /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt; 
</code></pre>

<p>addNewUser.php</p>

<p>Here i am doing validations and displaying error messages and if it is success sending him to another page.</p>

<p>But i want to show an error message on addUser.php instead of validations page. Please give me a sample code how i can do it.</p>
