백엔드 개발 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 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 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 – 배송 주소 변경 iTunes Store에 이 메시지가 나타나는 주된 이유는 AppleID 프로필에 올바른 주소가 없기 때문입니다. 1단계 – 먼저 iPhone에서 iPhone 설정을 엽니다. 2단계 – AppleID는 다른 모든 설정보다 우선해야 합니다. 그러니 열어보세요. 3단계 – 거기에서 “결제 및 배송” 옵션을 엽니다. 4단계 – Face ID를 사용하여 액세스 권한을 확인하세요. 단계

이벤트 뷰어에서 이벤트 ID 55, 50, 98, 140 디스크 오류 수정 이벤트 뷰어에서 이벤트 ID 55, 50, 98, 140 디스크 오류 수정 Mar 19, 2024 am 09:43 AM

Windows 11/10의 이벤트 뷰어에서 이벤트 ID 55, 50, 140, 98이 발견되거나, 디스크 파일 시스템 구조가 손상되어 사용할 수 없다는 오류가 발생하는 경우, 아래 안내에 따라 문제를 해결하시기 바랍니다. 이벤트 55, 디스크의 파일 시스템 구조가 손상되어 사용할 수 없음은 무엇을 의미합니까? 세션 55에서 Ntfs 디스크의 파일 시스템 구조가 손상되어 사용할 수 없습니다. 볼륨에서 chkMSK 유틸리티를 실행하십시오. NTFS가 트랜잭션 로그에 데이터를 쓸 수 없으면 이벤트 ID 55의 오류가 트리거되어 NTFS가 트랜잭션 데이터를 쓸 수 없는 작업을 완료하지 못하게 됩니다. 이 오류는 일반적으로 디스크에 불량 섹터가 있거나 파일 시스템의 디스크 하위 시스템이 부적절하여 파일 시스템이 손상된 경우에 발생합니다.

알리바바 ID는 어디서 찾을 수 있나요? 알리바바 ID는 어디서 찾을 수 있나요? Mar 08, 2024 pm 09:49 PM

Alibaba 소프트웨어에서는 계정 등록이 완료되면 시스템에서 플랫폼에서 귀하의 신원 역할을 하는 고유 ID를 할당합니다. 하지만 많은 사용자들은 자신의 ID를 조회하고 싶지만 어떻게 해야 할지 모릅니다. 그러면 이 웹사이트의 편집자가 아래 전략 단계에 대한 자세한 소개를 제공할 것입니다. 도움이 되기를 바랍니다! 알리바바 ID에 대한 답변을 찾을 수 있는 곳: [Alibaba]-[My]. 1. 먼저 홈페이지에 들어간 후 오른쪽 하단에 있는 [내]를 클릭해야 합니다. 2. 그런 다음 내 페이지로 이동하면 페이지 상단에 [id]가 표시됩니다. 아이디는 타오바오와 동일한가요? 알리바바 아이디와 타오바오 아이디는 다른데 둘이 맞나요?

uniapp에서 드래그 앤 드롭 정렬 및 드래그 앤 드롭 작업을 구현하는 방법 uniapp에서 드래그 앤 드롭 정렬 및 드래그 앤 드롭 작업을 구현하는 방법 Oct 19, 2023 am 09:39 AM

Uniapp은 크로스 플랫폼 개발 프레임워크로, 강력한 크로스 엔드 기능을 통해 개발자는 다양한 애플리케이션을 빠르고 쉽게 개발할 수 있습니다. Uniapp에서는 드래그 앤 드롭 정렬과 드래그 앤 드롭 동작을 구현하는 것도 매우 간단하며, 다양한 컴포넌트와 요소의 드래그 앤 드롭 동작을 지원할 수 있습니다. 이 기사에서는 Uniapp을 사용하여 드래그 앤 드롭 정렬 및 드래그 앤 드롭 작업을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 드래그 앤 드롭 정렬 기능은 많은 응용 프로그램에서 매우 일반적입니다. 예를 들어 목록 드래그 앤 드롭 정렬, 아이콘 드래그 앤 드롭 정렬 등을 구현하는 데 사용할 수 있습니다. 아래에 우리가 나열

이벤트 ID 4660: 개체가 삭제되었습니다. [수정] 이벤트 ID 4660: 개체가 삭제되었습니다. [수정] Jul 03, 2023 am 08:13 AM

독자 중 일부는 이벤트 ID4660을 경험했습니다. 그들은 무엇을 해야 할지 확신하지 못하는 경우가 많으므로 이 가이드에서 이에 대해 설명합니다. 이벤트 ID 4660은 일반적으로 개체가 삭제될 때 기록되므로 컴퓨터에서 이 문제를 해결할 수 있는 몇 가지 실용적인 방법도 살펴보겠습니다. 이벤트 ID4660이란 무엇입니까? 이벤트 ID 4660은 Active Directory의 개체와 관련되어 있으며 다음 요소에 의해 트리거됩니다. 개체 삭제 – Active Directory에서 개체가 삭제될 때마다 이벤트 ID 4660이 포함된 보안 이벤트가 기록됩니다. 수동 변경 - 사용자 또는 관리자가 개체의 사용 권한을 수동으로 변경할 때 이벤트 ID 4660이 생성될 수 있습니다. 이는 권한 설정을 변경하거나, 액세스 수준을 수정하거나, 사람이나 그룹을 추가 또는 제거할 때 발생할 수 있습니다.

Tencent Video ID 확인하는 곳 Tencent Video ID 확인하는 곳 Feb 24, 2024 pm 06:25 PM

Tencent Video ID는 어디서 확인할 수 있나요? Tencent Video 앱에는 전용 ID가 있지만 대부분의 사용자는 Tencent Video ID를 확인하는 방법을 모릅니다. 다음은 Tencent Video ID를 확인하는 방법에 대한 그래픽 튜토리얼입니다. 관심 있는 사용자를 위한 편집자입니다. Tencent Video 사용 튜토리얼 Tencent Video ID 확인 방법 1. 먼저 Tencent Video 앱을 열고 메인 페이지 오른쪽 하단의 [개인 센터]를 통해 특별 영역에 들어갑니다. 2. 그런 다음 개인 센터 페이지에 들어가서 [ 3. 설정 페이지로 이동하여 하단의 [계정 탈퇴]를 클릭하세요. 4. 마지막으로 아래와 같은 페이지에서 전용 ID 번호를 확인할 수 있습니다.

C++sort 함수의 기본 원리와 알고리즘 선택을 살펴보세요. C++sort 함수의 기본 원리와 알고리즘 선택을 살펴보세요. Apr 02, 2024 pm 05:36 PM

C++정렬 함수의 맨 아래 계층은 병합 정렬을 사용하고 복잡도는 O(nlogn)이며 빠른 정렬, 힙 정렬 및 안정 정렬을 포함한 다양한 정렬 알고리즘 선택을 제공합니다.

C#에서 Array.Sort 함수를 사용하여 배열 정렬 C#에서 Array.Sort 함수를 사용하여 배열 정렬 Nov 18, 2023 am 10:37 AM

제목: Array.Sort 함수를 사용하여 C#에서 배열을 정렬하는 예 텍스트: C#에서는 배열이 일반적으로 사용되는 데이터 구조이므로 배열 정렬 작업이 필요한 경우가 많습니다. C#에서는 배열을 편리하게 정렬할 수 있는 Sort 메서드가 있는 Array 클래스를 제공합니다. 이 문서에서는 C#에서 Array.Sort 함수를 사용하여 배열을 정렬하는 방법을 보여주고 구체적인 코드 예제를 제공합니다. 먼저 Array.Sort 함수의 기본 사용법을 이해해야 합니다. 배열.그래서

See all articles