Академический Документы
Профессиональный Документы
Культура Документы
DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form method="post">
<h1 align="center"> Login Page</h1>
<table align="center">
<tr>
<td> Username : </td>
<td> <input type="text" name="username" palceholder="Enter username"
required></td>
</tr>
<tr>
<td> Password : </td>
<td> <input type="password" name="userpass" palceholder="Enter
passsword" required></td>
</tr>
</table>
<table align="center">
<tr>
<td> <input type="submit" name="submit" value="Login"
formaction="studentdata.jsp" style="margin-left: 40px; margin-top : 20px"></td>
</tr>
</table>
</form>
</body>
</html>
progrM JSP
</tr>
<%
Connection conn;
try
{
Class.forName("com.mysql.jdbc.Driver");
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/employee","root","");
Statement stat = conn.createStatement();
String sql="select * from studentdetail";
int count=0,count2=0;
ResultSet rs2 = stat.executeQuery(sql);
while(rs2.next())
{
count++;
}
//out.println("Number of Rows" +count);
out.println("</tr>");
} %>
</table>
<table align="center">
<tr>
<td> <input type="submit" name="submit" value="Insert
Selected"> </td>
<td> <input type="submit" name="absent" value="ALL
Absent"> </td>
<td> <input type="submit" name="present" value="ALL
Present"> </td>
</tr>
</table>
<%
if(request.getParameter("absent")!=null)
{
if(request.getParameter("submit")!=null)
{
count2=0;
int j;
String select[] = request.getParameterValues("id");
// flag settting
String attan = "Present";
String attan2 = "Absent";
String sql4,sql5;
}
rs.close();
conn.close();
}
catch(SQLException e1)
{
}
catch(Exception e)
{
}
%>
</table>
</form>
</body>
</html>