ASP

 

 

header.asp

<%@Language="VBScript" CODEPAGE="65001" %>
<%
    ' 한글깨짐 방지 처리
   Response.CharSet="utf-8"
   Session.codepage="65001"
   Response.codepage="65001"
   Response.ContentType="text/html;charset=utf-8"

%>
<% response.buffer=true  %>

<html lang="ko">
<head>
<title>macaronics</title>
   <meta http-equiv="content-type" content="text/html"; charset="utf-8" >
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <!-- 위 3개의 메타 태그는 *반드시* head 태그의 처음에 와야합니다; 어떤 다른 콘텐츠들은 반드시 이 태그들 *다음에* 와야 합니다 -->
   <title>macaronics</title>
   <!-- 부트스트랩 -->
   <!-- 합쳐지고 최소화된 최신 CSS -->
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
   <!-- 부가적인 테마 -->
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
   <!-- 합쳐지고 최소화된 최신 자바스크립트 -->
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
   <!-- IE8 에서 HTML5 요소와 미디어 쿼리를 위한 HTML5 shim 와 Respond.js -->
   <!-- WARNING: Respond.js 는 당신이 file:// 을 통해 페이지를 볼 때는 동작하지 않습니다. -->
   <!--[if lt IE 9]>
     <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
   <![endif]-->
   <!-- Bootstrap core JavaScript
   ================================================== -->
   <!-- Placed at the end of the document so the pages load faster -->
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>


<style>
#header_menu, #navbar, .navbar navbar-inverse navbar-static-top{
background:#EE7785;
color: white;
}
#header_menu .navbar-header{
  color: white;
}
.navbar-inverse .navbar-brand{
  background:#EE7785;
}

.navbar-inverse .navbar-nav>li>a{
  color:white;
}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.open>a{
  background:#337AB7;
}

#navbar .navbar-nav>li>a:hover, #navbar  .navbar-nav>li>a:hover{
  background:#337AB7;
}


#footer {
   position:fixed;
   left:0px;
   bottom:0px;
   height:60px;
   width:100%;
   background:#EE7785;
   color: white;

}
#footer  p {

   text-align: center;
   vertical-align: middle;
}
</style>

 

header_menu.asp

<div class="navbar-wrapper">
      <div class="container">
        <nav class="navbar navbar-inverse navbar-static-top">
          <div class="container" id="header_menu">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Macaronics</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>

            </div>
            <div id="navbar" class="navbar-collapse collapse">
              <ul class="nav navbar-nav">
                <li><a  href="/asp-shoppingMall/mall/">ASP mall</a></li>
                <li class="active"><a href="/asp-shoppingMall/mall/adduser.asp">회원 등록</a></li>
                <%
                  if session("id1") ="" then
                %>
                  <li><a href="/asp-shoppingMall/mall/login.asp">로그인</a></li>
                <%
                  else
                %>
                        <li><a href="/asp-shoppingMall/mall/memberList.asp">회원록록</a></li>
                        
                        <li><a href="/asp-shoppingMall/mall/logout.asp">로그아웃</a></li>
                        <li class="dropdown">
                          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><%= session("id1")  %>님 환영합니다.
                            <span class="caret"></span></a>
                          <ul class="dropdown-menu" role="menu">
                            <li><a href="/asp-shoppingMall/mall/regedit.asp">회원정보 수정</a></li>
                            <li><a href="#">Another action</a></li>
                            <li><a href="#">Something else here</a></li>
                            <li class="divider"></li>
                            <li class="dropdown-header">Nav header</li>
                            <li><a href="#">Separated link</a></li>
                            <li><a href="#">One more separated link</a></li>
                          </ul>
                        </li>

                <%
                  end if
                %>

                </ul>


            </div>
          </div>
        </nav>
      </div>
    </div>

 

dbcon.asp

<%

    Dim dbConnect, db '변수 선언'
    ' DB 연결 접속 정보 변수 저장
    dbConnect = "Provider=SQLOLEDB; Data Source=CJH-PC;Initial Catalog=braverokmc; User id=braverokmc;password=1111"
    ' 연결 객체 생성
    Set db = server.createObject("ADODB.Connection")
    ' 데이터베이스 접속
    db.open dbConnect


%>

 

regedit.asp

<!--#include  virtual=./asp-shoppingMall/mall/include/header.asp -->
<%
  if session("id1") ="" or isNull(session("id1")) then
   '세션 값이 없으면 메인으로 이동
    response.redirect("/asp-shoppingMall/mall")
  end if

  if session("id1")="guest" then
    response.write "<script>alert('계정은 정규회원이 아니므로 회원정보를 수정할 수 없습니다. '); location.href='/asp-shoppingMall/mall';</script>"
  end if
%>

<script>
$(document).ready(function() {

    $("#btnRegist").click(function(e){
          var form =document.form1;


          if(form.passwd.value.length==0){
            alert("비밀번호를 입력하세요.");
            form.passwd.focus();
            return false;
          }

          if(form.username.value.length==0){
            alert("이름을 입력하세요.");
            form.username.focus();
            return false;
          }

          if(form.email.value.length==0){
            alert("이메일을 입력하세요.");
            form.email.focus();
            return false;
          }

          if(form.tel.value.length==0){
            alert("전화번호를 입력하세요.");
            form.tel.focus();
            return false;
          }

          if(form.address.value.length==0){
            alert("주소를 입력하세요.");
            form.address.focus();
            return false;
          }

          if(form.age.value.length==0){
            alert("나이를 입력하세요.");
            form.age.focus();
            return false;
          }

          if(form.sex.value.length==0){
            alert("성별을 입력하세요.");
            form.sex.focus();
            return false;
          }

          form.submit();
    });


});
</script>
</header>
<body>
<!--#include file=dbcon.asp   -->
<%
    sql1 ="select * from usert where  id1='"& session("id1") &"'"
    Set rs1=db.Execute(sql1)

%>


<!--#include virtual="./asp-shoppingMall/mall/include/header_menu.asp" -->

<div class="rows">
<div class="container">

   <div clss="col-xs-12 col-sm-12">
      <h1 class="bg-primary text-center" style="width:100%; padding-top:20px; padding-bottom:20px; text-align:center">회원 정보 수정</h1>
      <div class="col-xs-3 col-sm-3"></div>
     <div class="col-xs-6 col-sm-6">

        <p>&nbsp;</p>
        <p class="text-center">
          <span style="color:red;">* ID 를 제외한 모든 항목을 변경시킬 수 있습니다.</span>
        </p>
       <form method="post" action="regeditOk.asp" name="form1" >
         <table class="table table-striped" >
            <tr>
              <th>등록할 회원 ID </th>
              <td><%= rs1("id1") %></td>
            </tr>

            <tr>
              <th>등록할 비빌번호 </th>
              <td><input type="password" value=""  class="form-control" name="passwd" /></td>
            </tr>

            <tr>
              <th>이름 </th>
              <td><input type="text"  class="form-control" name="username"  value="<%= rs1("username") %>"/></td>
            </tr>

            <tr>
              <th>Email  </th>
              <td><input type="email"  class="form-control" name="email" value="<%= rs1("email") %>" /></td>
            </tr>

            <tr>
              <th>연락처 </th>
              <td><input type="tel"   class="form-control" name="tel" value="<%= rs1("tel") %>" /></td>
            </tr>


            <tr>
              <th>현주소 </th>
              <td><input type="text"  class="form-control"  name="address" value="<%= rs1("address") %>" /></td>
            </tr>


            <tr>
              <th>나이 </th>
              <td><input type="number" max="100" min="1" class="form-control"  name="age"  value="<%= rs1("age") %>" /></td>
            </tr>


            <tr>
              <th>성별 </th>
              <td>
                <select name="sex" class="form-control">
                    <option value="남" <% if rs1("sex")="남"  then response.write "selected" end if %> >남</option>
                    <option value="여"  <% if rs1("sex")="여" then response.write "selected"  end if %> >여</option>
                </select>
              </td>
            </tr>

            <tr class="text-center">
              <td colspan="2">
                <input type="hidden" name="id1" value="<%= rs1("id1")%>" >
                <button type="button" class="btn-success" id="btnRegist">정보변경하기</button>
              </td>
            </tr>
         </table>
     </form>

     </div>
   </div>


</div>
</div>



<!--#include  virtual=./asp-shoppingMall/mall/include/footer.asp -->

 

 

 

 

 

 

 

 

 

 

제작  소스 - Junho  choi  - macaronics  : https://github.com/braverokmc79/asp-shoppingMall

 

 

 

about author

PHRASE

Level 60  라이트

나는 운명의 목을 죄어 주고 싶다. 어떤 일이 있더라도 운명에 져서는 안 된다. -베토벤

댓글 ( 0)

댓글 남기기

작성