Advertisement
Guest User

Untitled

a guest
May 16th, 2015
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.20 KB | None | 0 0
  1. <%@page import="java.util.Date"%>
  2. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  3.  
  4. <%
  5. String name=(String) request.getAttribute("name");
  6. String names=(String) session.getAttribute("name");
  7. %>
  8.  
  9. <!DOCTYPE html>
  10. <html>
  11.     <head>
  12.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  13.         <link rel="stylesheet" type="text/css" href="style.css">
  14.         <title>JSP Page</title>
  15.     </head>
  16.     <body>
  17.  
  18.         <script type="text/javascript">
  19.             function form_validation(){
  20.             var name=document.Login_Form.login_name.value;
  21.             var password=document.Login_Form.login_password.value;
  22.             var flag = true;            
  23.             if(name==""){
  24.                 document.getElementById("invalid_login").style.color="red";
  25.                 document.getElementById('invalid_login').innerHTML="UserName is mandatory!";
  26.                 flag = false;
  27.             }            
  28.             if(password==""){
  29.                 document.getElementById("invalid_login").style.color="red";
  30.                 document.getElementById('invalid_login').innerHTML="Password is mandatory!";
  31.                 flag = false;
  32.             }    
  33.             return flag;
  34.             }
  35.         </script>
  36.        
  37.         <!--div id="date">  Current Time =  <%=new Date() %> </div-->
  38.         <div id="invalid_login"> </div>
  39.         <% String authentication = (String) session.getAttribute("authentication");            
  40.            if (authentication == null) {
  41.        %>                
  42.         <div id="login_in">
  43.             <form name="Login_Form" action="Controller" method="Post">
  44.                 <div align="right">                      
  45.                     Username    <input  type="text" maxlength="40" name="login_name"> &nbsp;&nbsp;
  46.                     Password    <input type="password" maxlength="40" name="login_password">            
  47.                     <input type="submit" name="login_submit" value=" Submit " onclick="return form_validation()">  
  48.                  
  49.  
  50.                     <a href="registration.jsp"> Register </a>
  51.                 </div>                    
  52.             </form>
  53.             <% }
  54.                if (authentication != null) { if(authentication.equals("Auth_Success"))
  55.                { // out.println("authentication = " + authentication);
  56.            %>
  57.             <div id="user_info">  <span style="color:green">   <i> </i>  </span> </div>
  58.             <form name="logout" action="Controller" method="Post">
  59.                 <div class="logmeout"> <input type="submit" name="signout" value=" Logout "> </div>
  60.             </form>            
  61.             <%} else { %>
  62.             <div id="wrong_user"> <span style="color:red"> Username/Password is wrong! </span> </div>
  63.               <form name="Login_Form" action="Controller" method="Post">
  64.                 <div id="login_in" align="right">                      
  65.                     Username    <input  type="text" maxlength="40" name="login_name"> &nbsp;&nbsp;
  66.                     Password    <input type="password" maxlength="40" name="login_password">            
  67.                     <input type="submit" name="login_submit" value="Submit" onclick="return form_validation()">            
  68.                     <a href="registration.jsp"> Register </a>
  69.                 </div>                    
  70.             </form>
  71.          
  72.             <%}}%>
  73.  
  74.         </div>  
  75.         <div id="big_wrapper">            
  76.             <header id="top_header">  BOOK SHOP </header>
  77.              
  78.             <section id="main_content">
  79.                 <article id="main_article">
  80.                     <select name="Item">
  81.                         <option> Fantasy </option>
  82.                         <option> Education </option>
  83.                         <option> Thriller</option>
  84.                     </select>
  85.                 </article>
  86.                 <article id="main_article">
  87.                   Welcome in my bookshop. You can buy  here everything what you want.
  88.                 </article>            
  89.             </section>
  90.  
  91.             <aside id="updates"> zdjecie </aside>
  92.             <footer id="the_footer"> @Copyright Rafał Anioł 2015 </footer>
  93.         </div>
  94.     </body>
  95. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement