每当我点击网站内的网页链接时如何修复,我都会退出?

时间:2015-07-09 17:12:24

标签: javascript php mysql security session

我有一个内部网站点,其中有多个页面链接链接到每个页面上站点内的其他页面。问题是,如果我登录到我的个人资料,例如我没有问题,但是如果我点击一个链接说出我的索引页面或最近的新闻页面或者我带到页面的任何东西但是我退出了,我必须再次登录。我发现,如果用户的密码是"""

我有这个站点的两个版本,唯一的区别是它们连接到不同的数据库。在一个域上一切正常,另一个是我遇到这个问题。

这是连接到数据库的每个页面的顶部,并检查用户是否具有正确的凭据和一些功能。我认为问题应该是代码检查用户凭据和/或启动会话。

<?php

    // Connect To Secure Login
    $cfgProgDir = 'phpSecurePages/';
    include($cfgProgDir . "secure.php");
    //These are the includes needed to make the php page run
    // this file connects to the database
    include("includes/connect.inc.php");
    // This file holds all the custom functions
    include("includes/functions.inc.php"); 

这是配置文件

$cfgIndexpage = '/index.php';

    $cfgServerHost = '********************';             // MySQL hostname
    $cfgServerPort = '';                      // MySQL port - leave blank for default port
    $cfgServerUser = '*********';                  // MySQL user
    $cfgServerPassword = '**********';                  // MySQL password

    $cfgDbDatabase = '******';        // MySQL database name containing phpSecurePages table
    $cfgDbTableUsers = 'members';         // MySQL table name containing phpSecurePages user fields
    $cfgDbLoginfield = 'firstName';                // MySQL field name containing login word
    $cfgDbPasswordfield = 'password';         // MySQL field name containing password
    $cfgDbUserLevelfield = 'permission';       // MySQL field name containing user level
      // Choose a number which represents the category of this users authorization level.
      // Leave empty if authorization levels are not used.
    $cfgDbUserIDfield = 'id';        // MySQL field name containing user


    /****** Data ******/
    /* this data is necessary if no database is used */
    $cfgLogin[1] = '';                        // login word (username)
    $cfgPassword[1] = '';                     // password
    $cfgUserLevel[1] = '0';                    // user level

并且连接文件($ connect)只连接我的数据库

有关问题的建议吗? :)

1 个答案:

答案 0 :(得分:2)

这可能意味着你的会话在某处被破坏或者没有设置cookie。

我没有太多关注代码(它有点乱)但是...... secure.php在第67行包含checklogin.php。在checklogin.php文件,第37行,{{调用1}}并在配置文件中再次调用它。

它应该发出警告,如果你还没有看到它,你要么使用的是旧版本的PHP,要么你没有启用错误报告。

您应启用错误报告并检查是否有任何通知或警告。