这是用户登录的代码
enter.php
<?php session_start(); include("conn/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 24px}
.k {
border-top-style: dashed;
border-right-style: dashed;
border-bottom-style: dashed;
border-left-style: dashed;
border-top-color: #6699CC;
border-right-color: #6699CC;
border-bottom-color: #6699CC;
border-left-color: #6699CC;
}
-->
</style>
</head><body>
<?php if($_SESSION["lt_user"]==""){ ?>
<table width="460" height="343" border="0" align="center" class="k">
  <script language="JavaScript" type="text/javascript">
function check_user(form){
if(form.user.value==""){
     alert("请输入会员名");
form.user.select();
return(false);
}
if(form.lt_pwd.value==""){
     alert("请输入登录密码!");
form.lt_pwd.select();
return(false);
    }
if(form.lt_yzm.value==""){
     alert("请输入验证码!");
form.lt_yzm.select();
return(false);
    }
    return(true);  
 }
</script>
  <script language="JavaScript" type="text/javascript">
function getback_pass(){
window.open("getback_pass.php","newframe","left=200,top=200,width=240,height=140,menubar=no,toolbar=no,location=no,scrollbars=no,location=no");}
</script>  <form action="enter_ok.php" method="post" name="form1" id="form1" onsubmit="return check_user(this)">
  
    <tr bgcolor="#33CCCC">
      <td colspan="3" align="left" bgcolor="#6699CC"><span class="STYLE1">论坛注册用户请直接登录</span></td>
    </tr>
    <tr>
      <td width="133" align="right"><span class="STYLE1">用户名:</span></td>
      <td colspan="2"><label>
        <input name="user" type="text" id="user" size="30" />
      </label></td>
    </tr>
    <tr>
      <td height="62" align="right"><span class="STYLE1">密码:</span></td>
      <td colspan="2"><label>
        <input name="lt_pwd" type="password" id="lt_pwd" size="30" />
      </label></td>
    </tr>
    <tr>
      <td height="70" align="right" valign="baseline"><span class="STYLE1">验证码:</span></td>
      <td width="137" valign="baseline"><label>
        <input name="lt_yzm" type="text" id="lt_yzm" value="" size="15" />
        &nbsp;&nbsp;&nbsp;&nbsp;</label></td>
      <td width="168"><img src="lt_yzm.php" width="66" height="57" /></td>
    </tr>
    <tr>
      <td colspan="3" align="center"><label>
        <input name="Submit" type="submit" class="STYLE1" value="登录" />

        <span class="STYLE1">|</span>
      </label>
        <span class="STYLE1"><a href="getback_pass.php">忘记密码</a></span></td>
    </tr>
    <tr>
      <td colspan="3"><hr /></td>
    </tr>
    <tr>
      <td colspan="3" align="center"><a href="register.php">没有注册,立即注册</a></td>
    </tr>
  </form>
</table>
<?php
}else{
$sqlu=mysql_query("select * from lt_user where lt_user='".$_SESSION["lt_user"]."'",$conn);
$infou=mysql_fetch_array($sqlu);

?>
<script type="text/javascript" src="js/xmlHttpRequest.js"></script>
<script language="javascript">
function show_counts(sender){ 
url='show_counts.php?sender='+sender;
xmlHttp.open("get",url, true);
xmlHttp.onreadystatechange = function(){
if(xmlHttp.readyState == 4){
tet = xmlHttp.responseText;
show_counts11.innerHTML=tet;
}
}
xmlHttp.send(null);
}
</script>
<script language="javascript">
setInterval("show_counts('<?php echo $_SESSION["lt_user"];?>')",1000); 
</script></body>
</html>
<?php
}
?>
enter_ok.php
<?php session_start();
$lt_yzm=trim($_POST[lt_yzm]);
class check_user{
   var $user;
   var $lt_pwd;
   var $lt_yzm;
  function check_user($x,$y,$m){
    $this->user=$x;
    $this->lt_pwd=$y;
$this->lt_yzm=$m;
   }   function check_input(){
     if($this->lt_yzm!=$_SESSION["validate1"]){
        echo "<script>alert('验证码输入错误!');history.go(-1);</script>";
        exit;
      }
     include_once("conn/conn.php");
 $sql=mysql_query("select lt_user from lt_user where lt_user='".$this->user."'",$conn);
 $info=mysql_fetch_array($sql);
 if($info==false){
    echo "<script>alert('对不起,不存在该用户!');history.back();</script>";
    exit;
  }else{ 
    $sql=mysql_query("select lt_user from lt_user where lt_user='".$this->user."' and pwd='".$this->lt_pwd."'",$conn);
    $info=mysql_fetch_array($sql);
    if($info==false){
   echo "<script>alert('对不起,密码输入错误!');history.back();</script>";
   exit;
 }else{ 
             if($_SESSION["lt_user"]!=""){
  session_unregister("lt_user");
 }   
             session_register("lt_user");
 
             $_SESSION["lt_user"]=$this->user; 
     echo "<script>alert('登录成功!');history.back();</script>";
 } 
   } 
       mysql_close($conn);   
   } 
 }
 $chk=new check_user($_POST[user],md5($_POST[lt_pwd]),$lt_yzm);
 $chk->check_input();
?>
我想让他登陆成功后转到index.php页,而不是仍在enters.php页。我该加一句什么代码?要怎么实现该功能