Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Tolls

Thread: Register,login page,connection dao

  1. #1
    mamtha is offline Member
    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0

    Default Register,login page,connection dao

    tyt



    register page




    <%@ page language="java" import="java.sql.*" %>


    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>
    <title>Nsep</title>

    <link rel="stylesheet" href="../css/styllensep.css" type="text/css" />
    <script type="text/javascript">
    window.history.forward();
    function noBack()
    {
    window.history.forward();
    }
    setTimeout("noBack()", 0);



    function msg()
    {
    if(sid.length<6)
    {
    document.getElementById("error1").innerHTML="*Stud ent's ID should be in integers and exactly 6 digits"
    document.cal.sid.focus();ide=1;
    ret=ret+1;
    }
    }
    if(ide==0)
    {
    document.getElementById("error1").innerHTML=""
    }



    var ac=0;
    var bb=document.cal.sname.value;

    if(bb==""||bb==0)
    {
    document.getElementById("error2").innerHTML="*Ente r the Student Name"
    document.cal.sname.focus();
    ac=1;
    ret=ret+1;
    }

    var a=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz';
    for(j=0;j<bb.length;j++)

    {

    if(a.indexOf(bb.charAt(j))<0)

    {

    document.getElementById("error2").innerHTML="*Stud ent Name Should not contain Intergers or Special characters"
    ac=1;
    document.cal.sname.focus();
    ret=ret+1;
    }


    }

    if(ac==0)
    {
    document.getElementById("error2").innerHTML=""
    }



    var rr=0;
    var c='0123456789';
    var b1=document.cal.sage.value;
    if(b1=="" || b1.length!=2)
    {
    rr=1;
    document.getElementById("error3").innerHTML="*age cannot be empty and should be of 2 digits.";
    document.cal.sage.focus();
    ret=ret+1;
    }
    for(j=0;j<b1.length;j++)
    {
    if(c.indexOf(b1.charAt(j))<0)
    {
    rr=1;
    document.getElementById("error3").innerHTML="*Ente r a vaild age";
    document.cal.sage.focus();
    ret=ret+1;
    }
    }
    if(rr==0)
    {
    document.getElementById("error3").innerHTML="";

    }






    var ad=0;
    var bc=document.cal.sphn.value;

    if(bc=="")
    {
    document.getElementById("error4").innerHTML="*Ente r Student's Contact Number"
    document.cal.sphn.focus();
    ad=1;
    ret=ret+1;
    }
    else if(bc<7000000000){
    document.getElementById("error4").innerHTML="*Ente r Valid Contact Number"
    document.cal.sphn.focus();
    ad=1;
    ret=ret+1;
    }
    if(bc!="")
    {
    if(isNaN(bc))
    {
    document.getElementById("error4").innerHTML="*Stud ent's contact number should be in integers"
    document.cal.sphn.focus();
    ad=1;
    ret=ret+1;
    }

    if(bc.length<10)
    {
    document.getElementById("error4").innerHTML="*Stud ent's contact Number should be in integers and exactly 10 digits"
    document.cal.sphn.focus();ad=1;
    ret=ret+1;
    }
    }
    if(ad==0)
    {
    document.getElementById("error4").innerHTML="";
    }



    var g=0;

    var b3=document.cal.saddr.value;
    if(b3=="" || b3.length<20)
    {

    var g=1;
    document.getElementById("error5").innerHTML="*Addr ess should be more than 20 characters";
    document.cal.saddr.focus();
    ret=ret+1;
    }
    else
    {

    document.getElementById("error5").innerHTML="";
    }




    var m=0;
    var bb=document.cal.sloc.value;

    if(bb==""||bb==0)
    {
    document.getElementById("error6").innerHTML="*Ente r the Location"
    document.cal.sloc.focus();
    m=1;
    ret=ret+1;
    }
    var a=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz';
    for(j=0;j<bb.length;j++)

    {

    if(a.indexOf(bb.charAt(j))<0)

    {

    document.getElementById("error6").innerHTML="*Loca tion Should not contain Intergers or Special characters"
    ac=1;
    document.cal.sloc.focus();
    ret=ret+1;
    }


    }

    if(m==0)
    {
    document.getElementById("error6").innerHTML="";
    }












    var r=0;
    var z=document.cal.scoll.value;
    if(z=="ch2")
    {
    r=1;
    document.getElementById("error7").innerHTML="*Sele ct College";
    ret=ret+1;
    }
    else
    {
    document.getElementById("error7").innerHTML="";

    }



    var f=0;
    var z=document.cal.syr;
    if(z.selectedIndex ==0)
    {
    f=1;
    document.getElementById("error8").innerHTML="*Sele ct Year";
    ret=ret+1;
    }
    else
    {
    document.getElementById("error8").innerHTML="";

    }



    var h=0;
    var z=document.cal.scom;
    if(z.selectedIndex ==0)
    {
    h=1;
    document.getElementById("error9").innerHTML="*Sele ct commited amount";
    ret=ret+1;
    }
    else
    {
    document.getElementById("error9").innerHTML="";

    }

    var pw=0;
    var sspwd=document.cal.spwd.value;
    if(sspwd=="")
    {
    document.getElementById("error10").innerHTML="*Ent er Password"
    document.cal.sid.focus();
    pw=1;
    ret=ret+1;
    }

    if(ret!=0)
    {
    return false;
    }
    }

    </script>
    </head>
    <body onload="noBack()">
    <div id="logo">
    </div>
    <div id="back">
    </div>


    <div id="sidenav">

    <p><a href="addstudent.jsp">Add Student</a></p>
    <p><a href="searchstu.jsp" >View profile</a></p>
    <p><a href="updatestu.jsp" >Update Details</a></p>
    <p><a href="deletestu.jsp" >Delete Student</a></p>
    <p><a href="Studentdisplayall.jsp" >List all Student</a></p>
    </div>
    <div id="wrapper">

    <ul id="navigation">
    <li><a href="Employeehome.html">Home</a></li>
    <li><a href="Aboutusemp.html">About us</a></li>
    <li><a href="Contactusemp.html">Contact us</a></li>
    <li><a href="Empprofile.jsp">Profile</a></li>
    <li><a href="homestu1.jsp">Student</a></li>
    <li><a href="Collhome.html">College</a></li>
    <li><a href="logout.jsp">Logout</a></li>

    </ul>
    </div>


    <center>
    <form id="form1" method= "post" name="cal" onsubmit="return msg();">

    <div id="p2" >

    <div id="error1" style=color:red></div>
    <div id="error2" style=color:red></div>
    <div id="error3" style=color:red></div>
    <div id="error4" style=color:red></div>
    <div id="error5" style=color:red></div>
    <div id="error6" style=color:red></div>
    <div id="error7" style=color:red></div>
    <div id="error8" style=color:red></div>
    <div id="error9" style=color:red></div>
    <div id="error10" style=color:red></div>

    <table cellpadding="6">

    <th><h2>Register a student </h2></th>



    <tr align="left"><td><label id="p1">Student ID:<span class=b>*</span></label></td><td> <input type="text" name="sid" maxlength="6"/></td></tr>
    <tr align="left"><td><label id="p1">Student Name:<span class=b>*</span></label></td><td> <input type="text" name="sname" maxlength="20"/></td></tr>
    <tr align="left"><td><label id="p1">Age:<span class=b>*</span></label></td><td> <input type="text" name="sage" maxlength="2" /></td></tr>

    <tr align="left"><td><label id="p1"> Mobile Number:<span class=b>*</span></label></td>

    <td><input type="text" name="sname1" value="+91" disabled maxlength="3" size="3"/>

    <input type="text" name="sphn" maxlength="10" size="10" /></td></tr>
    <tr align="left"><td><label id="p1">Address:<span class=b>*</span> </label></td><td> <input type="text" name="saddr" /></td></tr>
    <tr align="left"><td><label id="p1">Location:<span class=b>*</span> </label></td><td> <input type="text" name="sloc" maxlength="10" /></td></tr>
    <tr align="left"><td><label id="p1">College name: <span class=b>*</span></label></td><td><select name="scoll">
    <option value="ch2">Select College</option>
    </select></td></tr>


    <tr align="left"><td><label id="p1">Current education<span class=b>*</span></label></td><td><select name="syr">


    <option value="ch2">-Select-</option>
    <option value="I">I</option>
    <option value="II">II</option>
    <option value="III">III</option>



    </select> </td></tr>
    <tr align="left"><td><label id="p1">Commited amount<span class=b>*</span></label></td><td><select name="scom">


    <option value="ch2">-Select-</option>
    <option value="2000">2000</option>
    <option value="3000">3000</option>
    <option value="4000">4000</option>
    <option value="5000">5000</option>


    </select> </td></tr>


    <tr align="left"><td><label id="p1">Password: <span class=b>*</span></label></td><td> <input type="password" name="spwd" /></td></tr>
    <tr><td></td><td><label id="p1"><span class=b>*</span> Mandatory Field</label></td></tr>
    </table>
    <input type="hidden" name="page" value="create"></input>
    <div style=text-align:center><button type="submit">Submit</button></div>
    </form>
    </center>
    </body>
    </html>




    login page
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Nsep</title>

    <link rel="stylesheet" href="../css/styllensep1.css" type="text/css" />
    <script type="text/javascript">




    function msg()
    {
    var ide=0;
    var sid=document.cal.sid.value;
    if(sid=="")
    {
    document.getElementById("error").innerHTML="*Enter Student's ID"
    document.cal.sid.focus();
    ide=1;
    return false;
    }
    if(sid!="")
    {
    if(isNaN(sid))
    {
    document.getElementById("error").innerHTML="*Stude nt's ID number should be in integers"
    document.cal.sid.focus();
    ide=1;
    return false;
    }

    if(sid.length<6)
    {
    document.getElementById("error").innerHTML="*Stude nt's ID should be in integers and exactly 6 digits"
    document.cal.sid.focus();ide=1;
    return false;
    }
    }
    if(ide==0)
    {
    document.getElementById("error").innerHTML=""
    }
    var pw=0;
    var sspwd=document.cal.password.value;
    if(sspwd=="")
    {
    document.getElementById("error").innerHTML="*Enter Password"
    document.cal.sid.focus();
    pw=1;
    return false;
    }
    if(pw==0)
    {
    document.getElementById("error").innerHTML=""
    }

    }


    </script>
    </head>
    <body onload=>
    <div id="logo">
    </div>



    <div id="wrapper">

    <ul id="navigation">
    <li><a href="/nsep_emp1/html/Mainhome.html">Home</a></li>
    <li><a href="aboutus.jsp">About us</a></li>
    <li><a href="contactus.html">Contact</a></li>
    <li><a href="login.html">Employee</a></li>
    <li><a href="loginstu.jsp">Student</a></li>
    </ul>
    </div>
    <center>
    <form id="form6" name="cal" method="post" onsubmit="return msg();">
    <div >


    <div id="error" style=color:red></div></div>
    <h1 id="p1">Student login</h1>
    <label id="p1"><b>User ID</b><span class=b>*</span></label><input type="text" name="sid" maxlength=6></input><br/><label id="p1"><b>password</b><span class=b>*</span></label><input type="password" name="password"></input><br/>

    <input type="hidden" value="login" name="page">

    <label id="p1"><span class=b>*</span> Mandatory Field</label>
    <br/>
    <input type="submit" value="Login"></input>

    </form>
    </center>
    </body>
    </html>
    Last edited by mamtha; 01-12-2012 at 06:34 PM. Reason: err

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,182
    Rep Power
    20

    Default Re: Register,login page,connection dao

    Lovely.
    A whole splurge of code and HTML, and no question at all.
    You'll go far.
    quad64bit likes this.

Similar Threads

  1. Oracle connection and register
    By digioleg in forum New To Java
    Replies: 1
    Last Post: 08-19-2009, 08:43 PM
  2. login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-09-2008, 09:37 AM
  3. JSP login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-06-2008, 05:23 AM
  4. login page
    By keerthi_y19 in forum New To Java
    Replies: 9
    Last Post: 08-06-2008, 12:58 PM
  5. Login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-03-2008, 03:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •