Share Pastebin
Guest
Public paste!

Dionei Cardozo

By: a guest | Feb 11th, 2010 | Syntax: ASP | Size: 3.78 KB | Hits: 379 | Expires: Never
Copy text to clipboard
  1. Index.asp
  2.  
  3.  
  4. <%@LANGUAGE="VBSCRIPT"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <title>Untitled Document</title>
  10. <style type="text/css">
  11. <!--
  12. .style1 {color: #0099CC}
  13. .style2 {
  14.         font-size: 16px;
  15.         font-weight: bold;
  16. }
  17. .style3 {color: #009933}
  18. -->
  19. </style>
  20. </head>
  21.  
  22. <body>
  23. <div align="center" class="style2">
  24.   <h2 class="style3">Preencha nosso Login</h2>
  25. </div>
  26. <form id="form1" name="form1" method="post" action="login.asp">
  27. <table width="400" border="0" align="center" cellpadding="1" cellspacing="1">
  28.   <tr>
  29.     <td width="53"><span class="style1">Usuario</span></td>
  30.     <td width="340"><label>
  31.       <input type="text" name="usuario" id="usuario" />
  32.     </label></td>
  33.   </tr>
  34.   <tr>
  35.     <td><span class="style1">Senha</span></td>
  36.     <td><label>
  37.       <input type="password" name="senha" id="senha" />
  38.     </label></td>
  39.   </tr>
  40.   <tr>
  41.     <td>&nbsp;</td>
  42.     <td><label>
  43.       <input type="submit" name="button" id="button" value="Logar" />
  44.     </label></td>
  45.   </tr>
  46. </table>
  47. </form>
  48. </body>
  49. </html>
  50.  
  51.  
  52. Admin.asp
  53.  
  54.  
  55. <%@LANGUAGE="VBSCRIPT"%>
  56. <%
  57. If not Session("logado") = true then
  58. response.redirect("erro.asp")
  59. Response.End
  60. End if
  61. %>
  62. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  63. <html xmlns="http://www.w3.org/1999/xhtml">
  64. <head>
  65. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  66. <title>Untitled Document</title>
  67. <style type="text/css">
  68. <!--
  69. .style1 {color: #006699}
  70. -->
  71. </style>
  72. </head>
  73.  
  74. <body>
  75. <div align="center">
  76.   <h2 class="style1">Bem vindo a nossa Area restrita  </h2>
  77. </div>
  78. <div align="center"><br />
  79.   <br />
  80.     <a href="sair.asp">Sair</a>
  81. </div>
  82. </body>
  83. </html>
  84.  
  85.  
  86.  
  87. Erro.asp
  88.  
  89.  
  90.  
  91. <%@LANGUAGE="VBSCRIPT"%>
  92. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  93. <html xmlns="http://www.w3.org/1999/xhtml">
  94. <head>
  95. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  96. <title>Untitled Document</title>
  97. <style type="text/css">
  98. <!--
  99. .style1 {color: #0099CC}
  100. .style2 {
  101.         font-size: 16px;
  102.         font-weight: bold;
  103. }
  104. .style3 {color: #009933}
  105. .style4 {
  106.         color: #FF0000;
  107.         font-weight: bold;
  108. }
  109. -->
  110. </style>
  111. </head>
  112.  
  113. <body>
  114. <div align="center" class="style2">
  115.   <h2 class="style3">Preencha nosso Login</h2>
  116. </div>
  117.  
  118. <div align="center" class="style4">
  119.   <h4>Usuario ou senha incorretos </h4>
  120. </div>
  121. <form id="form1" name="form1" method="post" action="login.asp">
  122. <table width="400" border="0" align="center" cellpadding="1" cellspacing="1">
  123.   <tr>
  124.     <td width="53"><span class="style1">Usuario</span></td>
  125.     <td width="340"><label>
  126.       <input type="text" name="usuario" id="usuario" />
  127.     </label></td>
  128.   </tr>
  129.   <tr>
  130.     <td><span class="style1">Senha</span></td>
  131.     <td><label>
  132.       <input type="password" name="senha" id="senha" />
  133.     </label></td>
  134.   </tr>
  135.   <tr>
  136.     <td>&nbsp;</td>
  137.     <td><label>
  138.       <input type="submit" name="button" id="button" value="Logar" />
  139.     </label></td>
  140.   </tr>
  141. </table>
  142. </form>
  143. </body>
  144. </html>
  145.  
  146.  
  147.  
  148. Login.asp
  149.  
  150.  
  151. <%@LANGUAGE="VBSCRIPT"%>
  152. <%
  153. Dim usuario,senha
  154.  
  155.      usuario = "admin"
  156.          senha   = "123456"
  157.          
  158.   If Request.Form("usuario") = usuario and Request.Form("senha") = senha then
  159.  
  160.   Session("logado") = true
  161.   Response.redirect("admin.asp")
  162.   else
  163.   Response.redirect("erro.asp")
  164.  
  165.   End if
  166. %>
  167.  
  168.  
  169.  
  170. Sair.asp
  171.  
  172.  
  173. <%@LANGUAGE="VBSCRIPT"%>
  174. <%
  175. If not Session("logado") = true then
  176. response.redirect("index.asp")
  177. End if
  178. Session.Abandon()
  179. response.redirect("index.asp")
  180. %>