RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR

싸이월드처럼 주소뒤에 아이디로 페이지이동 구현



<!--#include virtual="인클루드파일"-->
<%
'=============================================================================
'
'   404 에러 페이지
'       note. 커뮤니티를 url로 손쉽게 접근하기 위해서 404트릭 이용
'             url을 검사해서 TB_COMM.comm_domain 에 있는 도메인이라면
'             http://www.xxxaa.kr/도메인   으로 바로이동하도록 처리
'
'       환경설정 : 1. iis에서 웹사이트 선택후 등록정보
'                  2. 사용자정의 오류탭에서 404에러 선택
'                  3. 형식을 URL로바꾸고 URL은 이파일 경로를 적는다.
'                  4. 원래 404파일 경로 C:WINNThelpiisHelpcommon404b.htm
'
'
'       작성자 : 손민창 2005-02-25 2:40오후
'=============================================================================

    dim strQueryString      ' 쿼리스트링
    dim errorURL            ' 에러 url
    dim errorNum            ' 에러번호
    dim url_comm_domain     ' URL에서 커뮤니티 도메인을 얻어온다.
    dim strServerURL        ' 서버 URL
    dim strServerPort       ' 서버 Port

    dim strSql
    dim db_comm_idx
    dim db_comm_name

    strQueryString  = Request.ServerVariables("QUERY_STRING")
    strServerURL    = "http://"&Request.ServerVariables("SERVER_NAME")&"/"
    strServerPort   = Request.ServerVariables("SERVER_PORT")

    errorNum = (Split(strQueryString,";"))(0)
    errorURL = (Split(strQueryString,";"))(1)

    ' 404에러이면서 뒤의 url이 "/"로 끝나지 않을경우 아래 구문 실행
    if errorNum = "404" and right(errorURL,1) <> "/" then
        url_comm_domain = replace(errorURL,strServerURL,"")
        strSql = "select comm_idx, comm_name from TB_COMM where comm_domain='"&url_comm_domain&"'"
        Set rs = x.Execute(strSql)
        if not rs.eof then
            db_comm_idx = rs(0)
            db_comm_name= rs(1)
            Call CommunityFramePage(db_comm_idx, db_comm_name)
        end if
        rsClose(rs)
    end if
   
    Call ErrorPage_404(errorURL)


'=======================================================
' 함수/프로시저 모음
'=======================================================
    '---------------------------------------------------
    ' 커뮤니티 화면을 보여주는 함수
    '---------------------------------------------------
    Sub CommunityFramePage(comm_idx, comm_name)
        dim outStr
        outStr = outStr & "<html>" & vbCrLf
        outStr = outStr & "<head>" & vbCrLf
        outStr = outStr & "<title>[커뮤니티] " & comm_name & "</title>" & vbCrLf
        outStr = outStr & "</head>" & vbCrLf
       
        outStr = outStr & "<frameset rows=""0,*"" border=0>" & vbCrLf
        outStr = outStr & "    <frame src=""about:blank"" name=blank marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 noresize>" & vbCrLf
        outStr = outStr & "    <frame src=""/community/default.asp?comm_idx="&comm_idx&""" name=body  scrolling=auto marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>" & vbCrLf
        outStr = outStr & "</frameset>" & vbCrLf
        outStr = outStr & "</html>" & vbCrLf
        Response.Write outStr
        Response.End
    End Sub
   
    '---------------------------------------------------
    ' 404 에러페이지 보여주는 함수
    '---------------------------------------------------
    Sub ErrorPage_404(errorURL)
        Response.Write errorURL & " 파일을 찾을 수 없습니다"
    End Sub

%>

이올린에 북마크하기
2007/04/24 14:27 2007/04/24 14:27
http://jiny.kr/trackback/13
전체 (406)
지니소식 (4)
자료실 (4)
정보|뉴스 (5)
SmartPhone (1)
Languages (206)
Server (153)
Database (27)
Design (4)
Gallery (0)
분류하기귀찬.. (2)
«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
  1. 창의력과 상상력을 넘어서  2009
    Tomcat 6.0 기본 환경 설정
  2. 닥공  2009
    서블릿 tomcat 6.0 실행시 에러
  1. 2010/07 (1)
  2. 2010/05 (1)
  3. 2010/02 (3)
  4. 2010/01 (3)
  5. 2009/05 (2)
Statistics Graph