dongping1689 2010-07-29 08:12
浏览 15

登录功能的其他声明并不总是正常工作

The code below is part of a PHP / MySQL login system that I am using. It determines whether or not the login fields are displayed, and it is supposed to only display them when the user is not logged in. Sometimes it displays them when is user is logged in, logging the user out.

Any ideas on what I should look for to trouble shoot this?

Thanks in advance,

John

<?php
if (!isLoggedIn())
{

    if (isset($_POST['cmdlogin']))
    {

        if (checkLogin($_POST['username'], $_POST['password']))
        {
            show_userbox();

        } else
        {
            echo "Incorrect Login information !";
            show_loginform();
        }
    } else
    {

        show_loginform();
    }

} else
{

    show_userbox();

}

?>
  • 写回答

2条回答 默认 最新

  • drpmazn9021 2010-07-29 08:15
    关注

    You might try :

    <?php
    if (!isLoggedIn())
    {
    
        if (isset($_POST['cmdlogin']))
        {
    
            if (checkLogin($_POST['username'], $_POST['password']))
            {
                show_userbox();
    
            } else
            {
                echo "Incorrect Login information !";
                show_loginform();
            }
        } else
        {
    
            show_loginform();
        }
        exit();
    
    } else
    {
    
        show_userbox();
    
    }
    
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行