Current File : /home/obabain/anms_obaba_in/exist.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ include file="Connection.jsp" %>
    <%
    try{
        String uname=request.getParameter("username");
        System.out.print(uname);
            Statement ps = con.createStatement();
            //ps.setString(1,request.getParameter("uname"));
            ResultSet res = ps.executeQuery("SELECT  * FROM login WHERE uname ='"+uname+"'");
            
            if(res.next()){
                out.print("<span style='color:red;'>User name already exists</span>");
            }else{
                out.print("User name is valid");
            }
        }catch (Exception e){
            System.out.println(e);  
        }%>
<!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">
<script src="http://code.jquery.com/jquery-latest.min.js"
        type="text/javascript"></script>
<title>Insert title here</title>
</head>
<body>

</body>
</html>