Switch or if else...?

I am designing a site and am having some trouble with the php code. I have block that has a login panel loaded into it. When you login the panel disappears. I need the panel to disappear and a new php file to load in. There is a switch statement on the panel that removes it once logged in but I’m not sure how to get the other file to load in. I am thinking an if else statement would make sense. Can someone help mw write this.

Here is the code
login.php

$loginmessage="";

$_SESSION['sessionAfterLoginRedirect']=base64_encode($PG_TITLE);

if($_POST["btnLogin"] == "Login")
{
    $txtUserName = $_POST["txtUserName"];
    $txtPassword = $_POST["txtPassword"];
    $txtUserName = addslashes($txtUserName);
	$chkInvisible = $_POST['chkInvisible'];
  
	switch($chkInvisible)
	{
		case "Y":
			$visible = 'N';
		break;

		case "":
			$visible = 'Y';
		break;
    }//end switch
    $loginmessage = isValidLogin('user',$txtUserName,$txtPassword,$visible);
}//end if
?>
<script LANGUAGE="javascript">
 function validateLoginForm(){
     var frm = window.document.frmLogin;
     if(trim(frm.txtUserName.value) ==""){
        alert("Please enter a user name");
        frm.txtUserName.focus();
        return false;
     }else if(frm.txtPassword.value ==""){
        alert("Please enter password");
        frm.txtPassword.focus();
        return false;
     }
     return true;
 }
</script>
<script language="javascript" type="text/javascript" src="js/qTip.js"></script>

<h1>LOG IN</h1>
                          <table width="100%"  border="0" cellspacing="0" cellpadding="1">
						  <form name="frmLogin" method="POST" action = "" onSubmit="return validateLoginForm();">
                           <input type="hidden" name="btnLogin" value="Login">
							 <?php if(isset($loginmessage) && $loginmessage!='')
							       {
							 ?> 
							  <tr>
							    <td colspan="3" align="center" class="maintext_small warning"><?php echo $loginmessage;?></td>
						    </tr>
							<?php }//end if?>
							  <tr>
                                
                                <td width="64%"><input name="txtUserName" type="text" class="textbox_login" id="txtUserName" maxLength="50" size="15" title="User Name"></td>
                                <td width="30%">&nbsp;</td>
                              </tr>
                              <tr>
                                <td><input name="txtPassword" id="txtPassword" type="password" maxLength="50" size="15" class="textbox_login" title="Password"></td>
                                <td><input type="image" name="btnLogin" src="images/loginbutton.jpg" width="47" height="18"></td>
                            </tr>
                              <tr>
                               
                                <td colspan="2" align="left" class="forgotpassword"><a href="forgotpass.php">Forgot Password?</a></td>
                              </tr>
						    </form>
                          </table></td>
                        </tr>
                        
                        <tr>
                          <td><a class="signuplink" href="register.php">Sign Up Here</a></td>
                        </tr>
                      </table>

Not sure if this is the right file to work on. The index file is where the magic happens so I am thinking that is where the if else should be.

Site is: http://www.aubookswap.com/developer/developer/eswap2.1/index.php

Please help me get through this

Thanks

Here is the index.php code that loads the login.php file.

 <div id="mod3">
            
            <?php if ($_SESSION["guserid"] == "")
				{
						require("./includes/login.php");
				 }//end if
			?>
            
               
      	    </div> 

If else it is. I figured it out after writing this up.

ur site doesn’t look pretty on FF

Uploaded with ImageShack.us