steveh000 0 Newbie Poster

Hi Guys

I am really stuck and cant think for the heck is wrong with this.

I have a basic login jsp page that gets a username and password from a page and then sends them to a login Authentication jsp script,

i use

<sql:query var="dbData" >
SELECT * FROM Members WHERE username="${param.uName}" AND password="${params.pWord}"
</sql:query>

the actual query works fine and have tested it on the sql tab in phpmyadmin i then did a simple test <c:when test="${dbData.rowCount == 0}"> and if its 0 obv it has failed and i return to the login page.

Now the problem i have is that it is never finding anything when the login details are right, I am not getting any sql errors its just returning 0 results

Here is the full text of my loginAuth jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>


<sql:setDataSource scope="application"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://mysql.hartlepooldesign.co.uk/*******?"
user="*********"
password="***********"
/>


<c:remove var="loggedin" />

<jsp:useBean id="loggedin" class="beans.Members" scope="session">
    <jsp:setProperty name="loggedin" property="*" />
</jsp:useBean>



<sql:query var="dbData" >
SELECT * FROM Members WHERE username="${param.uName}" AND password="${params.pWord}"
</sql:query>




<c:choose>

<c:when test="${dbData.rowCount == 0}">
    
    <jsp:forward page="logfail.jsp">

     <jsp:param name ="rowCount" value="${dbDate.rowCount}"/>
   <jsp:param name ="uName" value="${param.uName}"/>
   <jsp:param name ="pWord" value="${param.pWord}"/>
    </jsp:forward>
    

</c:when>
    
    <c:otherwise>
        <jsp:forward page ="index.jsp" >
            <jsp:param name ="uName" value="${param.uName}"/>
        </jsp:forward>
    </c:otherwise>

</c:choose>

This did work at one point but then I was attempting to get the password field sha1 and then things went nuts

I hope someone can see where i am going wrong here lol

Thanks

Steve

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.