웹마스터 팁

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>여기에서부터 내용을 밑으로 쭈욱 코딩하시면 됩니다....";

?>
제목 글쓴이 날짜
어느날 로그인이 안된신다면..? 이걸 점검을.. 청개굴이 2010.09.13
플래시, 선택박스(??)가 로그인 박스 등을 튀어 나올 때 [4] file hhgyu 2010.08.26
모바일 레이아웃 로그인페이지 개선방법 [4] 스카이피아 2010.08.01
로그인시 다음과같은 오류가 발생합니다. 빠른답변좀 ㅠㅠ [3] file 푸팅 2010.05.10
로그인 스킨 수정 팁 - 신규 쪽지 수 보여주기 [17] file 러브스킬 2010.05.03
플래시 뒤로 로그인창 숨는 문제 [5] 김지훈295 2010.02.25
로그인 후 특정 그룹 페이지 가기 다른버전 [9] 눈물많은OrOi 2010.02.22
외부프로그램에서 제로보드 xe 및 그누보드 회원 연동(로그인) 하기 - 초간단 [1] 한이73 2010.02.03
로그인페이지와 새페이지 연결법 [2] poko 2010.01.30
Flash swf 플래쉬 때문에 로그인이나 메뉴가 감추어졌을때에... [5] file 태림씨야! 2010.01.23
메인 레이아웃에서 로그인이 안보이는 경우. 김찬회425 2009.12.06
로그인 폼에 관리자는 [Admin] 나타나게 하기 [4] file 오스카 2009.10.10
로그인이 안되거나 첨부파일이 등록이 안될때. [9] 똑디 2009.09.30
XE 서버 이전할 때 통채로 압축해서 옮기는 완벽한 방법-로그인, 첨부파일문제 해결 [5] 웰빙샵 지영 2009.09.15
http://www.도메인주소/~as/xe/ 로 로그인 접속후~ [3] wjnam 2009.09.07
로그인 & 파일 첨부 문제 [3] peter99 2009.06.29
로그인 후 그룹별로 다른 페이지로 가기 - 업데이트판 v1.5 [19] 무대포2 2009.06.24
로그인 페이지 만드는 방법 [5] 산토 2009.06.12
별도 페이지 로그인방법 cornet 2009.05.21
로그인 포인트 출력 위젯을 수정해보자 [花穗] 2009.03.27