How do I clear the page content after a form is submitted?
<p>I currently have this code in my project:
    

<pre><code>require_once('mysql.inc.php');
session_start();

if (!isset($_SESSION['username']) &amp;&amp; !isset($_SESSION['uid']))
{
    login_sequence();
}
else
{
    login_check($_SESSION['username'], $_SESSION['uid']);
}

function login_sequence()
{
    echo '&lt;p&gt;' . $pretext . '&lt;/p&gt;&lt;form method="post" action="" /&gt;&lt;label for="password"&gt;Password: &lt;/label&gt;&lt;input type="password" name="password" id="password" /&gt;&lt;input type="submit" value="Log In" /&gt;&lt;input type="hidden" name="submitted" /&gt;&lt;/form&gt;';
    if (isset($_POST['submitted']))
    {
        $pword = hash('sha256', $_POST['password']);
        $query = "SELECT pword FROM users WHERE user = 'guest'";
        $result = mysql_query($query);
        $return = mysql_fetch_assoc($result);
        if ($return['pword'] == $pword)
        {
            pageout();
        }
        else
        {
            echo 'You entered the wrong password, if you are not a member, please leave.';
        }
    }
}

function login_check($username, $uid)
{
}

function pageout()
{
    echo('
    &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
    "http://www.w3.org/TR/html4/strict.dtd"&gt;

    &lt;html lang="en-US"&gt;
        &lt;head&gt;
            &lt;title&gt;&lt;/title&gt;
            &lt;link rel="stylesheet" type="text/css" href="" /&gt;
        &lt;/head&gt;
        &lt;body&gt;
            &lt;div id="header"&gt;
            &lt;p&gt;WOOT&lt;/P&gt;
            &lt;/div&gt;
            &lt;div id=""&gt;
            &lt;/div&gt;
            &lt;div id="navigation"&gt;
            &lt;/div&gt;
            &lt;div id="footer"&gt;
            &lt;/div&gt;
        &lt;/body&gt;
    &lt;/html&gt;
    ');
}

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

<p>There is a single "Guest" password stored in a database, it accesses the database and checks the password entered by the user against the one stored in the database. I want to have it so after the form is submitted and the information is correct, on the same page the form disappears and the page appears. How do I do it? How do I get rid of the form to make room for the new page?</p>
