2016-07-30 2 views
-2

저희 회사는 서비스 소프트웨어를 재 설계 해달라고합니다. 나는 오래된 코드 중 일부를보고있다. 그것은 VB와 HTML의 조합처럼 보입니다. 그게 맞습니까? 그들이 사용하고있는 서버에는 몇 가지 액세스 DB가 있습니다. Idk 접근에 관한 것. 이 명령은 식별자와 관련된 대괄호를 제외하고는 SQL과 위험한 것처럼 보입니다. 아마도 근친상간의 정보 일 겁니다. 이것을 Visual Studio에서 공개적으로 액세스 할 수있는 응용 프로그램으로 다시 작성하려고합니다.ASP 로그인 페이지 내용

<% 
msgTxt = Request("msgTxt") 
If Request("Action") = "Log on" Then 
     sql = "SELECT [ID], [Password]" 
     sql = sql & " FROM [tbl Employees]" 
     sql = sql & " WHERE [ID] = '" & Request("EmpID") & "' AND [Password] = '" & Request("Password") & "'" 
     sql = sql & ";" 
     Set rs_logon = Session("Conn").execute(sql) 
     On Error Resume Next 
    empId = rs_logon("ID") 
     If empId <> "" AND Err.Number = 0 Then 
     On Error Goto 0 
       Session("svEmp") = empId 
       SQL = "SELECT [ID] FROM [tbl Employees] WHERE [ID] = '" & Session("svEmp") & "';" 
     set rs_emp = Session("Conn").Execute(SQL) 
      Session("svEmp") = rs_emp("ID") 
      Session("lastCompanyViewed") = "0" 

     SQL = "UPDATE DISTINCTROW [tbl Employees] SET " 
     SQL = SQL & "[Online] = True " 
     SQL = SQL & "WHERE [ID]='" & Session("svEmp") & "';" 
     Session("Conn").Execute(SQL) 
       redirTo = "default.asp" 
       If Request("referrer") <> "" Then 
         redirTo = Request("referrer") 
       End If 
     Response.Redirect redirTo 
     Else 
       msgTxt = "Sorry. That set of credentials is invalid." 
       Session("svEmp") = "" 
     End If 
End If 
If Request("Action") = "Log off" Then 
     SQL = "UPDATE DISTINCTROW [tbl Employees] SET " 
     SQL = SQL & "[Online] = False " 
     SQL = SQL & "WHERE [ID]='" & Session("svEmp") & "';" 
     Session("Conn").Execute(SQL) 
       Session("svEmp") = "" 
       redirTo = "logon.asp" 
     Response.Redirect redirTo 
End If 
%> 
<html> 
<head> 
<link rel="stylesheet" type="text/css" href="cogs.css" /> 
    <title>Log on</title> 
</head> 
<body background="" onload="javascript:if(document.all.EmpID.value==''){document.all.EmpID.focus();}"> 
    <table border="0" cellpadding="0" cellspacing="0" align="center"> 
    <tr style="height:28px;"> 
    <td style="height:28px;width:28px;background:url('images/blue_top_left.jpg');"></td> 
    <td style="height:28px;background:url('images/blue_top.jpg');"></td> 
    <td style="height:28px;width:28px;background:url('images/blue_top_right.jpg');"></td> 
    </tr> 
    <tr> 
    <td style="width:28px;background:url('images/blue_left.jpg');"></td> 
    <td style="background-color:2C9FF0;" align="center"> 
    <div align="center"><img src="images/rt_logo.gif"></div> 
    <br> 
    <%=msgTxt%> 
    <form method="post"> 
    <div>Identification:</div> 
    <input type="text" name="EmpID"> 
    <div>Password:</div> 
    <input type="password" name="Password"> 
    <br><br> 
    <br> 
    <input type="submit" class="button" name="Action" value="Log on" class="button"> 
    </form> 
    <br> 
    <div align="center"><img src="images/cogs_logo.gif"></div> 
    <div>&copy; <%=DatePart("yyyy",Date())%> ---------------------------, Inc.</div> 
    </td> 
    <td style="width:28px;background:url('images/blue_right.jpg');"></td> 
    <tr> 
    <tr style="height:28px;"> 
    <td style="height:28px;width:28px;background:url('images/blue_bottom_left.jpg');"></td> 
    <td style="height:28px;background:url('images/blue_bottom.jpg');"></td> 
    <td style="height:28px;width:28px;background:url('images/blue_bottom_right.jpg');"></td> 
    </tr> 
    <tr> 
    <td colspan="3" align="center"> 
    </td> 
    </tr> 
    </table> 
    <div align="center"> 
    <div><strong>This site is for the sole use of ------------ and its employees. All other use is strictly prohibited.</strong></div> 
    </div> 
    <%=Session("svEmp")%> 
</body> 
</html> 
+0

질문이 있으십니까? – Andrei

+0

** VB와 HTML의 조합처럼 보입니다. 맞습니까? ** – Flibertyjibbet

답변

0

이것은 고전적인 aspx 페이지입니다. < % %> 태그는 변수 또는 서버 측 기능을위한 자리 표시자인 서버 태그입니다. 보통 aspx 페이지와 같은 이름이지만 서버 측 코드가있는 vb 확장자가있는 코드 숨김 페이지가 있습니다.