웹마스터 팁

PHP프로그램을 작성한 후 소스코드 맨 윗부분에 아래의 소스를 삽입하면 됩니다.

그나마 보안에 신경쓰자면 패스워드를 DB에 저장해야겠지만,

쉽게 쓸 수 있는 단순한 관리자인증으로 좋은것같아 공유합니다.

특별한 소스는 아니지만 복사해서 붙여넣기만 하면 된다는 점이 편해서...+_+;;;




* 로그인 후의 내용에 로그아웃을 시켜주는 링크를 빠뜨리지 마세요~_~



<?

$admin_pass = "12345"; //비밀번호 수정해주세요.

// 여기부터 로긴 페이지
if ($action=="login_ok"){
        if ($password==$admin_pass){
                SETCOOKIE(logid, crypt($admin_pass));
        }
        else{
                echo"<script>alert ('비밀번호 틀렸잖아..-_-;;'); history.go(-1);</script>";
                exit;
        }
}
elseif ($logid!=crypt($admin_pass, $logid) || $action=="logout"){        
        if ($action=="logout"){        SETCOOKIE(logid, "");}
        echo"
        <table align='center' cellpadding='0' cellspacing='0' width='100%' height='100%'><form name=password action='$_SERVER[PHP_SELF]' method=post><input type=hidden name=action value=login_ok>
        <tr>
        <td align='center' valign='middle'>
                <table align='center' cellpadding='3' cellspacing='0' width='200'>
                
                <tr>
                        <td style='border-top-width:2px; border-bottom-width:1px; border-top-color:rgb(229,229,229); border-bottom-color:rgb(229,229,229); border-top-style:solid; border-bottom-style:solid;' height='26'>
                        <p align='left' style=font-size:9pt;>비밀번호 확인</p>
                        </td>
                </tr>
                
                <tr>
                        <td style='border-bottom-width:1px; border-bottom-color:rgb(229,229,229); border-bottom-style:solid;'>
                                <p align='center'><input type='password' name='password' size='21' style=font-size:12px;background-color:white;border-width:1;border-color:rgb(153,153,153); border-style:solid;height:18;margin:1; type=submit> <input type='submit' value='확인' style=width:50;font-size:12px;background-color:white;border-width:1;border-color:rgb(153,153,153); border-style:solid;height:18;margin:1; type=submit></p>
                        </td>
                </tr>

                <tr>
                        <td height=50></td>
                </tr></table>
        </td>
        </tr></form>
        </table>
        <script>document.password.password.focus(); </script>";
        exit;
}
// 여기까지 로그인

echo"<a href='$_SERVER[PHP_SELF]?action=logout'>로그아웃</a><br>여기에서부터 내용을 밑으로 쭈욱 코딩하시면 됩니다....";

?>
제목 글쓴이 날짜
SMTP 인증 회원가입 메일 인증 , 비밀번호 오류찾기 및 답변글 메일로 받기 [11] file FFHosting 2009.01.12
특정 도메인의 메일 주소로만 가입 인증 메일 보내기 [3] 박정욱 2009.03.28
인증메일 때문에 고생하시는 분 참고하세요. [17] 박용식 2010.10.14
성인인증 받는 소스입니다..... [17] q333 2003.01.12
PHP 인증 페이지를 만들자! - Lesson 1 수정본 #2 ☺[폐]허접-_- 2002.01.24
PHP 인증 페이지를 만들자! - Lesson 2 수정본 #1 [5] ☺[폐]허접-_- 2002.01.24
PHP 인증 페이지를 만들자! - Lesson 3 수정본 #1 [3] ☺[폐]허접-_- 2002.01.24
파일시스템에서 비밀번호 생성/수정/인증 [7] 두기두바 2002.01.10
웹 인증 보호, 윈도우 로그인 폼 이용 (authenticate) [9] file 둘리나라™ 2003.01.13
NZEO 이메일 인증 따라하기 [또 수정 --;] [44] file teslaMINT 2003.02.22
메일 인증시 기존 회원 전부 인증걸기;;; [4] teslaMINT 2003.03.04
홈페이지 관리자 모드 구축하기 (HTTP 인증, 중복 맞음) [10] file 9000㎒ 2003.11.01
PHP프로그램에 간단한 인증(로그인) 걸기. [15] Lepas 2004.08.09
[타키의 초보강좌]PHP 기초 강좌 제 1탄[패스워드 인증] [8] 타키 2004.10.23
htaccess를 활용하자 3탄! 사용자인증 [4] [쿨럭]블루엔젤 2003.01.23
qmail-1.03설치② (checkpassword 인증모듈) 비츠로 2003.02.28
qmail-1.03설치④ (vpopmail 인증모듈) 비츠로 2003.02.28
트래픽관리 Throttle-status 사용자 인증시키기 [1] Cksoft 2003.03.18
php 와 mysql 을 이용한 웹인증..(윈도우에서) 이성헌 2003.06.05
apache 서버에서 apache 인증 (윈도우에서 apm 설치후) 이성헌 2003.06.05