use on div at a time using $_SESSION
<p>I want to use one div at a time using an echo and $_SESSION. When I put this on the web it only shows $form. Can you see if I'm doing anything wrong?</p>

<pre><code>    $signedIn ='&lt;h3 id="throughHeader"&gt; Account options&lt;/h3&gt;&lt;br/&gt;
        &lt;p id="throughP"&gt; &lt;a href="convenientaccountinfo.php&gt; Account Info &lt;/a&gt;&lt;/p&gt;&lt;br/&gt;
        &lt;p id="throughP"&gt;&lt;a href="convenientaddaddress.php&gt; Add Address &lt;/a&gt;&lt;/p&gt;&lt;br/&gt;
        &lt;p id="throughP"&gt; &lt;a href="convenientaddcreditcard.php&gt; Add C. Card &lt;/a&gt;&lt;/p&gt;&lt;br/&gt;
        &lt;p id="throughP"&gt; &lt;a href="convenientsignout.php&gt; Sign Out &lt;/a&gt;&lt;/p&gt;';


        $form='&lt;form id="signInForm" method="POST" action=""&gt;&lt;h3 id="formHeader"&gt;Sign Into Account&lt;/h3&gt;&lt;br/&gt;
        &lt;p id="pRegister"&gt;&lt;a id="register" href="convenientregisterpage.php"&gt; Register &lt;/a&gt;&lt;/p&gt;&lt;br/&gt;
        &lt;label&gt;Email Addr:&lt;/label&gt;&lt;input type="text" name="userEmail" id="email" size="15"/&gt;&lt;br/&gt;
        &lt;label&gt;Password:&lt;/label&gt;&lt;input type="password" name="password" id="password" size="15"/&gt;&lt;br/&gt;
        &lt;input type="submit" value="Sign In" id="formSubmit" name="submit"/&gt; &lt;/form&gt;';

    $username = $_SESSION['userEmail'];
    if(!$username){
        $signedInForm="$form";
    }
    else{
        $signedInForm="$signedIn";
    }
}
</code></pre>

<p>This is the form POST with validating until it sets the $_SESSION. Thanks for looking at it again.</p>

<pre><code> $email=$_POST['userEmail'];
$password=$_POST['password'];
if(isset($_POST['submit'])){
    if(empty($email) || empty($password)){
    $msg_to_user3="Fill in both fields";
    }
    else{
    $results=mysql_query("SELECT * FROM register WHERE userEmail='$email'");
   if (mysql_num_rows($results)==0)
       $msg_to_user3 ="No such User";
    else
    {
      while ($login_row = mysql_fetch_assoc($results))
      {
       $password_db = $login_row['password'];
       if ($password!=$password_db){
         $msg_to_user3 ="Password doesn't match";
       }
         if ($password_db!=$password){

        $msg_to_user2="&lt;a id='forgetpassword' href='convenientforgotpassword.php'&gt;Forget Password&lt;/a&gt;";
     }
       else
       {
          $active = $login_row['active'];
          $userEmail = $login_row['userEmail'];
          if ($active==0){
             $msg_to_user3= "Activate account at ($userEmail) &lt;/p&gt;";
      }
         else
          { 
           $_SESSION['userEmail']=$username;//assign session
      }

      }
      }
    }
       }
}   
&lt;html&gt;
    &lt;body&gt;
    &lt;div id="formSignIn"&gt;
        &lt;?php echo $signedInForm ;?&gt;
        &lt;/div&gt;
    &lt;/body&gt;
    &lt;/htmo&gt;
</code></pre>
