hi ,
i made a login page and i am facing problem in its connectivity with the database (named users).
when i enter the email add. and password i should move on to home page but every time the login page displays....
please help me in dis...
the code for login.jsp is:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:if test="${param.txtlogin ne null}">
<sql:setDataSource driver="sun.jdbc.odbc.JdbcOdbcDriver" url="jdbc:odbc:dsn1" var="con" scope="session" />
<sql:query dataSource="${con}" var="rs">
select * from users where email_id=? and password=?
<sql:param value="${param.txtlogin}"/>
<sql:param value="${param.txtpassword}"/>
</sql:query>
<c:if test="${rs.rowCount eq 1}">
<c:set var="name" scope="session" value="${rs.rows[0].name}"/>
<c:set var="is valid" scope="session" value="true"/>
<c:set var="email" scope="session" value="${param.txtlogin}"/>
<
jsp:forward page="home.jsp"/>
</c:if>
</c:if>
<html>
<head>
<title>Login Page</title>
</head>
<body >
<form method=post >
login: <input type=text name="txtlogin" value="" size="30" /><br>
password:<input type=password name="txtpassword" value="" size="30" /><br>
<input type=submit value="login"/>
<a >register now</a>
</form>
</body>
</html>