首页 后端开发 php教程 请教上面这段登陆后台代码如何改成免登陆

请教上面这段登陆后台代码如何改成免登陆

Jun 13, 2016 pm 01:23 PM
id sort

请问下面这段登陆后台代码怎么改成免登陆
请问下面这段登陆后台代码怎么改成免登陆,就是打开这个文件就直接登陆,不用输入管理员帐号密码

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php define('SUB_DIR','/services');
session_start();
error_reporting(E_ALL ^ E_NOTICE);

if(!isset($_SESSION['adm_name']) || empty($_SESSION['adm_name']))
    exit;

//2011-01-30 update
$actions = array('clear','getuser','updategoods','updatesite');
if(isset($_REQUEST['action']))
{
    $action = strtolower($_REQUEST['action']);

    if(!in_array($action,$actions))
        exit;
}
else
    exit;

set_time_limit(3600);

if(function_exists('ini_set'))
    ini_set('max_execution_time',3600);

require '../core/service/fanwe.service.php';

if($action == 'clear')
{
    $fanwe = &FanweService::instance();
    //2011-01-30 update
    $fanwe->is_admin = true;
    $fanwe->is_session = false;
    $fanwe->is_user = false;
    $fanwe->is_cron = false;
    $fanwe->cache_list = array();
    $fanwe->initialize();

    include_once import('function/cache');
    updateCache();

    clearDir(FANWE_ROOT.'./public/tpl');
    clearDir(FANWE_ROOT.'./admin/Runtime');
    clearDir(FANWE_ROOT.'./update/Runtime');

    //include FANWE_ROOT.'./ThinkPHP/Vendor/bbs.php';
    //BBSAction::getInstance()->updateSetting();

    $result = array("status"=>1,"info"=>'清除成功',"data"=>"");
    include import('class/json');
    $json = new JSON();
    die($json->encode($result));
}
//2011-01-30 update
elseif($action == 'updategoods')
{
    $fanwe = &FanweService::instance();
    $fanwe->is_admin = true;
    $fanwe->is_session = false;
    $fanwe->is_user = false;
    $fanwe->is_cron = false;
    $fanwe->cache_list = array('goods');
    $fanwe->initialize();

    set_time_limit(0);

    global $_FANWE;

    $begin = isset($_FANWE['request']['begin']) ? intval($_FANWE['request']['begin']) : 0;
    $begin = max($begin,0);

    if($begin == 0)
    {
        DB::query("DELETE FROM ".DB::table('cron')." WHERE type='goods'");
        DB::query("TRUNCATE TABLE ".DB::table('goods_now'));
        DB::query('REPLACE INTO '.DB::table('goods_now').'(id, site_id, site_name, name, city, cate_id, url, click_count, best_count, collect_count, 

shop_price, market_price, begin_time, end_time, brief, sort, small_img, big_img, score, is_best, bought, collect_buy, ef_time, post_count, r_sort, cr_sort, 

add_time) SELECT g.id, g.site_id, site_name, name, g.city, g.cate_id, url, click_count, best_count, collect_count, shop_price, market_price, begin_time, 

g.end_time, brief, g.sort, small_img, big_img, score, is_best, bought, collect_buy, ef_time, post_count, g.r_sort, g.cr_sort, add_time FROM '.DB::table

('goods_key').' AS gk INNER JOIN '.DB::table('goods').' AS g ON g.id = gk.id WHERE g.status = 1 AND gk.end_time > '.TIME_UTC);

        DB::query("TRUNCATE TABLE ".DB::table('goods_now_key'));
        DB::query('REPLACE INTO '.DB::table('goods_now_key').' SELECT id,site_id,city,cate_id,sort,r_sort,cr_sort,0,0,0,0,end_time FROM '.DB::table

('goods_now'));

        DB::query('DELETE FROM '.DB::table('goods_now_match').' 
            WHERE id NOT IN (SELECT id FROM '.DB::table('goods_now_key').')');
            
        DB::query('INSERT INTO '.DB::table('goods_now_match').' 
            SELECT gm.id,gm.content 
            FROM '.DB::table('goods_key').' AS gk 
            INNER JOIN '.DB::table('goods_match').' AS gm ON gm.id = gk.id 
            LEFT JOIN '.DB::table('goods_now_match').' AS gnm ON gnm.id = gk.id 
            WHERE gk.end_time > '.TIME_UTC.' AND gnm.id IS NULL');

        $begin = 0;
    }

    $sort_sites = array();
    $res = DB::query('SELECT site_id FROM '.DB::table('goods_key').' WHERE end_time > '.getTodayTime().' GROUP BY site_id');
    while($sid = DB::fetch($res))
    {
        $sort_sites[] = $sid['site_id'];
    }

    $data_num = count($sort_sites);
    echo "<script type='\"text/javascript\"'>document.write('数据表 goods_now 共 ".$data_num." 个站点<br/>');</script>"."\r\n";
    flush();
    ob_flush();

    if($data_num > $begin)
    {
        $site_id = $sort_sites[$begin];

        echo "<script type='\"text/javascript\"'>document.write('开始更新数据表 goods_now 站点 ".($begin + 1)."<br/>');</script>"."\r\n";
        flush();
        ob_flush();

        DB::query('TRUNCATE TABLE '.DB::table('goods_temp'));
        DB::query('REPLACE INTO '.DB::table('goods_temp').'
                SELECT id, site_id, city, cate_id, sort, @sort:=@sort + 1 as r_sort,0,0,0,0,0,end_time
                FROM '.DB::table('goods_now_key').' FORCE INDEX (site),(SELECT @sort:=0) AS t
                WHERE site_id = '.$site_id.' ORDER BY sort ASC,id DESC');

        if(DB::affectedRows() > 0)
        {
            $goods_cate_citys = array();
            $goods_cates = array();
            $goods_citys = array();
            $sql = '';
            $sql_jg = '';
            $res = DB::query('SELECT * FROM '.DB::table('goods_temp').' ORDER BY sort ASC,id DESC');
            while($goods = DB::fetch($res))
            {
                $cr_sort = 0;
                $d_sort = 0;
                $dc_sort = 0;
                $e_sort = 0;
                $ec_sort = 0;

                $city = $goods['city'];
                if(!isset($goods_citys[$city]))
                    $goods_citys[$city] = 0;
                $goods_citys[$city]++;
                $cr_sort = $goods_citys[$city];

                $cate_id = $goods['cate_id'];
                $cate = $_FANWE['cache']['goods']['cats'][$cate_id];
                if(!isset($goods_cates[$cate_id]))
                    $goods_cates[$cate_id] = 0;
                $goods_cates[$cate_id]++;

                if(!isset($goods_cate_citys[$cate_id][$city]))
                    $goods_cate_citys[$cate_id][$city] = 0;
                $goods_cate_citys[$cate_id][$city]++;

                $parent_id = $cate['pid'];
                if($parent_id > 0)
                {
                    $e_sort = $goods_cates[$cate_id];
                    $ec_sort = $goods_cate_citys[$cate_id][$city];

                    if(!isset($goods_cates[$parent_id]))
                        $goods_cates[$parent_id] = 0;
                    $goods_cates[$parent_id]++;

                    $d_sort = $goods_cates[$parent_id];

                    if(!isset($goods_cate_citys[$parent_id][$city]))
                        $goods_cate_citys[$parent_id][$city] = 0;
                    $goods_cate_citys[$parent_id][$city]++;

                    $dc_sort = $goods_cate_citys[$parent_id][$city];
                }
                else
                {
                    $d_sort = $goods_cates[$cate_id];
                    $dc_sort = $goods_cate_citys[$cate_id][$city];
                }

                $sql .= "$sql_jg($goods[id],$goods[site_id], '$city', $cate_id, $goods[sort], $goods[r_sort], $cr_sort, $d_sort, $dc_sort, 

$e_sort, $ec_sort, $goods[end_time])";
                $sql_jg = ',';
            }

            if($sql != '')
            {
                DB::query('REPLACE INTO '.DB::table('goods_temp').' VALUES '.$sql);
                DB::query('REPLACE INTO '.DB::table('goods_now_key').' SELECT * FROM '.DB::table('goods_temp'));
            }
        }

        usleep(10);
        DB::query('TRUNCATE TABLE '.DB::table('goods_temp'));
        DB::query('REPLACE INTO '.DB::table('goods_temp').'
                SELECT id, site_id, city, cate_id, sort, @sort:=@sort + 1 as r_sort,0,0,0,0,0,end_time
                FROM '.DB::table('goods_key').' FORCE INDEX (site),(SELECT @sort:=0) AS t
                WHERE site_id = '.$site_id.' AND end_time > '.getTodayTime().'
                ORDER BY sort ASC,id DESC');
        if(DB::affectedRows() > 0)
        {
            $goods_cate_citys = array();
            $goods_cates = array();
            $goods_citys = array();
            $sql = '';
            $sql_jg = '';
            $res = DB::query('SELECT * FROM '.DB::table('goods_temp').' ORDER BY sort ASC,id DESC');
            while($goods = DB::fetch($res))
            {
                $cr_sort = 0;
                $d_sort = 0;
                $dc_sort = 0;
                $e_sort = 0;
                $ec_sort = 0;

                $city = $goods['city'];
                if(!isset($goods_citys[$city]))
                    $goods_citys[$city] = 0;
                $goods_citys[$city]++;
                $cr_sort = $goods_citys[$city];

                $cate_id = $goods['cate_id'];
                $cate = $_FANWE['cache']['goods']['cats'][$cate_id];
                if(!isset($goods_cates[$cate_id]))
                    $goods_cates[$cate_id] = 0;
                $goods_cates[$cate_id]++;

                if(!isset($goods_cate_citys[$cate_id][$city]))
                    $goods_cate_citys[$cate_id][$city] = 0;
                $goods_cate_citys[$cate_id][$city]++;

                $parent_id = $cate['pid'];
                if($parent_id > 0)
                {
                    $e_sort = $goods_cates[$cate_id];
                    $ec_sort = $goods_cate_citys[$cate_id][$city];

                    if(!isset($goods_cates[$parent_id]))
                        $goods_cates[$parent_id] = 0;
                    $goods_cates[$parent_id]++;

                    $d_sort = $goods_cates[$parent_id];

                    if(!isset($goods_cate_citys[$parent_id][$city]))
                        $goods_cate_citys[$parent_id][$city] = 0;
                    $goods_cate_citys[$parent_id][$city]++;

                    $dc_sort = $goods_cate_citys[$parent_id][$city];
                }

 <div class="clear">
                 
              
              
        
            </div>
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

此 Apple ID 尚未在 iTunes Store 中使用:修复 此 Apple ID 尚未在 iTunes Store 中使用:修复 Jun 10, 2024 pm 05:42 PM

使用AppleID登录iTunesStore时,可能会在屏幕上抛出此错误提示“此AppleID尚未在iTunesStore中使用”。没有什么可担心的错误提示,您可以按照这些解决方案集进行修复。修复1–更改送货地址此提示出现在iTunesStore中的主要原因是您的AppleID个人资料中没有正确的地址。步骤1–首先,打开iPhone上的iPhone设置。步骤2–AppleID应位于所有其他设置的顶部。所以,打开它。步骤3–在那里,打开“付款和运输”选项。步骤4–使用面容ID验证您的访问权限。步骤

修复事件ID 55,50,98,140磁盘错误在事件查看器 修复事件ID 55,50,98,140磁盘错误在事件查看器 Mar 19, 2024 am 09:43 AM

若您在Windows11/10的事件查看器中发现事件ID55、50、140或98,或遇到磁盘文件系统结构损坏且无法使用的错误,请按照以下指南解决此问题。什么是事件55,磁盘上的文件系统结构损坏和不可用的意思?第55届会议,Ntfs磁盘上的文件系统结构损坏且无法使用。请在卷上运行chkMSK实用程序当NTFS无法将数据写入事务日志时,会触发事件ID55的错误,这将导致NTFS无法完成无法写入事务数据的操作。这种错误通常发生在文件系统损坏的情况下,可能是由于磁盘上存在坏扇区或文件系统对磁盘子系统的不

阿里巴巴id在哪里看 阿里巴巴id在哪里看 Mar 08, 2024 pm 09:49 PM

在阿里巴巴软件中,一旦您成功注册一个账号,系统就会为您分配一个独特的ID,这个ID将作为您在平台上的身份标识。但是对于许多用户来说,他们会想要查询自己的ID,但是却不知道该如何操作。那么本站小编带来下文中,就将为大家带来详细的攻略步骤介绍,希望能帮助到大家!阿里巴巴id在哪里看答案:【阿里巴巴】-【我的】。1、首先打开阿里巴巴软件,进入到首页中后我们需要点击右下角的【我的】;2、然后来到我的页面中后我们在页面的上方就可以看到【id】了;阿里巴巴id和淘宝一样吗阿里巴巴id和淘宝id不一样,但是二

事件 ID 4660:已删除对象 [修复] 事件 ID 4660:已删除对象 [修复] Jul 03, 2023 am 08:13 AM

我们的一些读者遇到了事件ID4660。他们通常不确定该怎么做,所以我们在本指南中解释。删除对象时通常会记录事件ID4660,因此我们还将探索一些实用的方法在您的计算机上修复它。什么是事件ID4660?事件ID4660与活动目录中的对象相关,将由以下任一因素触发:对象删除–每当从ActiveDirectory中删除对象时,都会记录事件ID为4660的安全事件。手动更改–当用户或管理员手动更改对象的权限时,可能会生成事件ID4660。更改权限设置、修改访问级别或添加或删除人员或组时,可能会发生这种情

uniapp中如何实现拖拽排序和拖拽操作 uniapp中如何实现拖拽排序和拖拽操作 Oct 19, 2023 am 09:39 AM

Uniapp是一款跨平台的开发框架,其强大的跨端能力使得开发者可以快速方便地开发出各种应用。在Uniapp中实现拖拽排序和拖拽操作也是非常简单的,并且可以支持多种组件和元素的拖拽操作。本文将介绍如何使用Uniapp实现拖拽排序和拖拽操作,并提供具体的代码示例。拖拽排序功能在很多应用中都非常常见,例如可以用于实现列表的拖拽排序,图标的拖拽排序等。下面我们以列表

腾讯视频id在哪里查看 腾讯视频id在哪里查看 Feb 24, 2024 pm 06:25 PM

腾讯视频id在哪里查看?腾讯视频APP中是有专属的id,但是多数的用户不知道如何查看腾讯视频id,接下来就是小编为用户带来的腾讯视频id查看方法图文教程,感兴趣的用户快来一起看看吧!腾讯视频使用教程腾讯视频id在哪里查看1、首先打开腾讯视频APP,主页面右下角【个人中心】进入到专区;2、之后进入到个人中心页面,选择【设置】功能;3、然后在设置页面,点击最下方【退出账号】;4、最后在下图所示的页面即可查看到专属的id号。

探究C++sort函数的底层原理与算法选择 探究C++sort函数的底层原理与算法选择 Apr 02, 2024 pm 05:36 PM

C++sort函数底层采用归并排序,其复杂度为O(nlogn),并提供不同的排序算法选择,包括快速排序、堆排序和稳定排序。

使用C#中的Array.Sort函数对数组进行排序 使用C#中的Array.Sort函数对数组进行排序 Nov 18, 2023 am 10:37 AM

标题:C#中使用Array.Sort函数对数组进行排序的示例正文:在C#中,数组是一种常用的数据结构,经常需要对数组进行排序操作。C#提供了Array类,其中有Sort方法可以方便地对数组进行排序。本文将演示如何使用C#中的Array.Sort函数对数组进行排序,并提供具体的代码示例。首先,我们需要了解一下Array.Sort函数的基本用法。Array.So

See all articles