这个是会员登录的页面,如果直接打开无法显示该网页,但如果通过其他页面登录了,就会提示您已经登录了,是什么原因
我的是WIN2003系统,程序是PHP5.3.3,
网站里还有几个页面也是跟这个类似,都是无法显示,兄弟们帮忙<?php
include_once('include/init.inc.php');                      
require_once("gb_1/hot.class.php");
$hot=new HOT($db);
if ($dang_uid) 
{
$ref="/".$_CFG['indentity'][$aVinfo['indentity']]."/".$aVinfo['id']."/";
exit("您已经登录了!<a href=$ref>返回</a>");
}
if(!empty($_POST))
{
$referer=html($_POST['referer']);
$sUserName = html(trim($_POST['username']));
$sPassWord = md5(strtolower(trim($_POST['password'])));
$from=html($_POST['from']);
$res=GetMember_M($sUserName,1);
if(!empty($res) && $res[password]==$sPassWord)
{
    $error="";
    if($res['indentity']==3 && $res['goodlevel']<=0)
{
$error='你的商家帐号需要通过实名认证才能正常使用';
}

if($res['isactive'] && $error=="")
{
//每日只在第一次登陆加分
credits_oper($res['uid'],'comm',2);
//////////////////////////
$cookietime=$_CFG['cookie']['expiry'];
setSysCookie($res['uid'],$res['username'],$res['indentity'],$res['password'],$res['nick'],$res['styleid'],$res['groupid'],$res['adminid'],$res['costid']);
$dang_uid=$res[uid];
$dang_ind_cn=$_CFG['indentity'][$res['indentity']];
if(strpos($referer,'thread-') || strpos($referer,'money/') || strpos($referer,'redirect.php') || strpos($referer,'weituo.php') || strpos($referer,'my/') || $from=='wrap_index')
$headerUrl=$referer;
else
{
//$headerUrl=($res['indentity']==2)?"/".$_CFG['indentity'][$res['indentity']]."/infocenter".$res['uid']."/":"/my/";
$headerUrl="/my/";
}
header("location: $headerUrl");
}
else
{
if($res['indentity']==3)
{
if ($error=="") $error='您需要激活才能正常使用';
}
else
{
$sEmailhref=strpbrk($res['email'],'@')?'http://www.'.str_replace('@','',strpbrk($res['email'],'@')):'http://www.123.com';
foreach($_CFG['email'] as $k=>$v)
{
if(strpbrk($res['email'],'@')=='@'.$v)
{
$sEmailhref=$_CFG['emailhref'][$k];
break;
}
}
$error='你还没有激活账号:<br />1、<a href="'.$sEmailhref.'" target="_blank">立刻去邮箱激活账号</a><br />2、通过邮箱 <a href="/login.php?act=active&oper=repeat" target="_blank">重新获取激活码</a> <a href="/login.php?act=active&oper=mdfmail" target="_blank">修改邮箱地址</a>';
}
}
}
else 
{
$error="用户名或密码输入错误! <a href=\"/get_password.php\" target=\"_blank\">找回密码?</a>";
}

}

//下面图片广告(热点145)3条数据
    $hot145=$hot->GetAllHotByBlockid(145);
foreach ($hot145 as $k=>$v)
    {
     $hot145[$k]['html']=$hot->GetHotFile($v['hotblockid'],$v['hotid'],trim($v['fileformat']),270,44,$v['url']);
    } 
//下面最新公告
$hot146=$hot->GetAllHotByBlockid(146);
foreach ($hot146 as $k=>$v)
    {
     $hot146[$k]['key']=$k+1;
    }

$hid_referer=html($_GET['referer'])?html($_GET['referer']):referer();
$TPL->assign('hid_referer',$hid_referer);
$TPL->assign('sUserName',$sUserName);
$TPL->assign('error',$error);
$TPL->assign('from',$from);
$TPL->assign('hot145',$hot145);
$TPL->assign('hot146',$hot146);
$TPL->display('login.html');
include_once(ROOT.'/templates/start/footer.html');
?>

解决方案 »

  1.   

    显示空白页面吗?在文件头上加上下面这一句看看会不会输出错误信息。
    error_reporting(E_ALL);
      

  2.   

    这个是放在根目录的,名字为login.php我是直接前面加网址打开这个页面的
      

  3.   


    <?php
        error_reporting(E_ALL);
        include_once('include/init.inc.php');                      
        require_once("gb_1/hot.class.php");
        $hot=new HOT($db);
        if ($dang_uid) 前面我改成这样的,但还是显示为无法显示,没有任何错误提示
      

  4.   

    检查一下php.ini,设置:
    display_errors = On
      

  5.   

    根目录下其它php文件能"直接打开"吗?
      

  6.   

    另外,浏览器提示"无法连接",有点怀疑你在浏览器地址栏中输入的url有问题,或者web服务没启动,又或者站点使用了非标准的80端口,而你在url中没有指定正确的端口号。。
      

  7.   

    我现在服务器上面就开了这一个站点,端口应该没问题吧,很多页面都是可以打开的,就是几个个别页面打开不了
    我不知道PHP是不是有什么配置,
    因为我感觉好像是跟调用html文件有关的,之前是在LINUX服务器上的,现在换成WIN2003的,用的是IIS
      

  8.   

    还有一种可能的情况,你在保存代码文件的时候,文件扩展名其实不是.php,而是其它的扩展名,比如.txt,整个文件的文件名其实成了login.php.txt,默认情况下,windows会隐藏常见格式的扩展名。
      

  9.   

    不是扩展名的问题
    之前程序是SVN发布的 ,不知道和这个有没有关系