登录页面登不进去的问题,不知道是session还是服务器环境的问题,我写了一个网站,处理页面是这个。每次登陆的时候都会说session前面有输出的东西,有时候服务器要登陆好几次才能登陆进去,我的环境用的是Appserv(mysql+Apache+php)的集成环境
<?php
session_start();
include("inc/db_conn.php");
$username=$_POST['username'];
$password=$_POST['password'];
$password=md5($password); 
$conn = new dbClass();$conn->Connect();
 
$sql="select * from user where Managers_name='".$username."' and Managers_pwd='".$password."'";
$num=$conn->SeleResout($sql);
if($num==0)
{
  echo "<script>alert('用户名或密码不正确');location.href='./login.php'</script>"; 
}
else
{
  $result=$conn->RetuenRow($sql);
    $row=mysql_fetch_array($result);
  $_SESSION['vpnusername']=$username;
  $_SESSION['vpnlogo']=$row['Managers_logo']; 
  if($row['Managers_logo']==0 )
 {
   echo "<script>location.href='./index.php'</script>";
 }else if( $row['Managers_logo']==1){//普管权限
 
  echo "<script>location.href='puguan/uindex.php'</script>";
 }else if( $row['Managers_logo']==2){//用户权限
 
  echo "<script>location.href='user/uindex.php'</script>";
 }
 else
 {
  echo "<script>alert('您目前还没有权限登录...');location.href='login.php'</script>";
 }
 }
?>