Opening and ending tag mismatch error in PHP script
<p>I am developing registration scripts for my website, but I am getting an error:</p>

<pre><code>Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and
ending tag mismatch: form and label in Entity, line: 132 in (path)
mergeformpost.inc.php on line 21
</code></pre>

<p>This happens in two different circumstances.</p>

<p>1) When the user enters data that already exists in a primary key field.</p>

<p>2) When the user enters the captcha challenge incorrectly.</p>

<p>This is (what I think) is the relevant code from mergeformpost.inc.php:</p>

<pre><code>function MergeFormPost( $page ) {


    set_error_handler( 'myErrorHandler', E_WARNING ) ;
    $dom = DOMDocument::loadHTML( $page-&gt;source );  //this is line 21
    restore_error_handler();

    if( $dom === false ) {
        writeErrorLog('Failed to parse HTML form.');
        return;
    }
</code></pre>
