Week Prgms
Week Prgms
Week Prgms
Jdbc.jsp:
<h2>Student List</h2>
<table border="1">
<tr>
<td><b>No</b></td>
<td><b>UserName</b></td>
<td><b>E-Mail</b></td>
<td><b>Phone</b></td>
</tr>
<%int num=1;
while(rs.next()){
%>
<tr>
<td><%=num%></td>
<td><%=rs.getString("name")%></td>
<td><%=rs.getString("email")%></td>
<td><%=rs.getString("phone")%></td>
</tr>
<%
num++;
}
rs.close();
stmt.close();
conn.close();
%>
</table>
</body>
</html>
<%}else{%>
<html>
<head>
<title>Student regestration page</title>
<script language="javascript">
function validation(Form_obj){
if(Form_obj.name.value.length==0){
alert("PLease fill up the remaining information");
Form_obj.name.focus();
return false;
}
if(Form_obj.mail.value.length==0){
alert("PLease fill up the remaining information");
Form_obj.mail.focus();
return false;
}
if((Form_obj.phone.value.length==0)||(Form_obj.phone.value.length>10)){
alert("PLease fill up the remaining information");
Form_obj.studphone.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<form action="jdbc.jsp" method="post" name="entry" onSubmit="return validation(this)">
<input type="hidden" value="list" name="action">
<table border="3">
<tr><td>
<table>
<tr>
<td colspan="2" align="center">
<h2>Student Entry Form</h2>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>Student Name:</td>
<td><input name="name" type="text" size="50"/></td>
</tr>
<tr>
<td>Student password:</td>
<td><input name="pwd" type="password" size="50"/></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input name="mail" type="text" size="50"/></td>
</tr>
<tr>
<td>Phone:</td>
<td><input name="phone" type="text" size="15"/></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit"/></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%}%>
WEEK 10:
Login.html:
<html>
<head>
<title>Login Page</title>
</head>
<body bgcolor="gold" >
<form action="jsplog.jsp" method="post" >
<table align="center" >
<tbody >
<tr >
<th> <font color="BLACK" face="calibri">
User Name:<input type="text" name="name"/> </th></tr>
<tr >
<th><font color="BLACK" face="calibri">
Password:<input type="password" name="pass"/> </th></tr>
<tr align="center">
<td><input type="submit" value="Submit" /> </td>
<td><input type="reset" value="Reset" /> </td>
</tr>
<tr>
<td colspan="2" align="center"><a href="register.html">Sign Up</a></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
Register.html:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="lightgreen" align="center">
<form action="jspreg.jsp" method="post" >
<table>
<tr><td>Name:</td>
<td><input type="text" name="name" /></td></tr>
<tr><td>Password:</td>
<td><input type="password" name="pass" /></td></tr>
<tr><td>Email id:</td>
<td><input type="text" name="eid" /></td></tr>
<tr><td>Ph. no:</td>
<td><input type="text" name="phno" /></td>></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Submit"
/></td></tr>
</table>
</form>
</body>
</html>
jsplog.jsp: