social networking community system

social networking community system

In the above mentioned title login page not working properly.

**1.login.jsp**
<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,com.minglespot.MyFunctions"%>
<%! String ErrCode="0",LoginCode="A";%>

 <HTML>
    <HEAD>
    <script LANGUAGE="Javascript" SRC="Images/validate.js"></script>
    <LINK href="styles.css" type="text/css" rel="stylesheet">
    <script LANGUAGE="Javascript" SRC="Images/calender.js"></script>
    <script LANGUAGE="Javascript" >
        function ChkMandatoryField(F,T){
            var val= F.value;
            if(val==""){alert(T+" is mandatory");return false;}
        }
        function ChkNumField(F,T){
            var val = F.value;
            if(isNaN(val)==true||val==""){alert("Please enter numbers for "+T);return false;}
        }
        function ChkAlphaNumericField(F,T){
            var val = F.value;
            var pattern = /^([a-zA-Z0-9]{1,250})$/;
            if(!(pattern.test(val)==true)){alert("Please enter alphabets or numbers for "+T);return false;}
        }
        function ChkAlphaField(F,T){
            var val = F.value;
            var pattern = /^([a-zA-Z ]{1,250})$/;
            if(!(pattern.test(val)==true)){alert("Please enter text for "+T);return false;}
        }
        function ChkEmailField(F,T){
            var val = F.value;
            var pattern = /^([a-zA-Z0-9\_\.]{4,25})$/;
            if(!(pattern.test(val)==true)){alert("Please enter valid email for "+T);return false;}
        }
        function ChkDateField(F,T)
        {
            var val = F.value;
            var pattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
            if(!(pattern.test(val)==true)){alert("Please enter valid date format (yyyy-mm-dd) for "+T);return false;}
        }
        function validate()
        {
            var frm = document.forms(0);
            if(ChkMandatoryField(frm.UserID,'UserID')==false) return false;
            if(ChkAlphaField(frm.UserID,'UserID')==false) return false;
            if(ChkMandatoryField(frm.uPassword,'Password')==false) return false;
            if(ChkAlphaNumericField(frm.uPassword,'Password')==false) return false;

        }
        function fnValidate(s){
        var frm = document.forms(0);
        var UserID=frm.UserID.value;
        //if(UserID==""){alert("User ID is mandatory");return false;}
        var uPassword=frm.uPassword.value;
        //if(uPassword==""){alert("Password is mandatory");return false;}
        s.href = "Validate.jsp?UserID="+UserID+"&Password="+uPassword;
        s.target="HomeFrame";
        }

    </script>
    </HEAD>
    <Body Class='Grad'>
    <FORM name="Login">
    <%
        ErrCode = request.getParameter("ErrCode");
        LoginCode = request.getParameter("LoginCode");  
        if(ErrCode!=null){
            if(ErrCode.equals("1")){
              %><script>alert("Login failed..please try again");</script><%
            }
        }
    %>
    <fieldset style="padding: 3;">
 <legend><FONT COLOR="" Face='verdana' size='2'><B>Login</B></FONT></Legend>

    <TABLE align=center width="60%" class="notepad">
        <TR class="row_title">
          <TH align="center" colspan=3><FONT SIZE="4" COLOR="#AA2504" face='monotype corsiva'>Login</FONT></TH>
        </TR>
        <tr>
          <TD align="left"><FONT SIZE="2" COLOR="#AA2504" face='monotype corsiva'>User ID</FONT><FONT COLOR="red">*</FONT></TD>
          <TD><Input type=text name='UserID' value=''  size=8></TD></tr>
          <tr><TD align="left"><FONT SIZE="2" COLOR="#AA2504" face='monotype corsiva'>Password<FONT COLOR="red">*</FONT></TD>
          <TD><Input type=password name='uPassword' value='' size=8></TD>
          <TD><a href="" onclick="fnValidate(this)"><img border="0" name="Go" src="Images/Go0.jpg" onmouseover="document['Go'].src='Images/Go1.jpg'" onmouseout="document['Go'].src='Images/Go0.jpg'" ></a></tr>

    </TABLE>
     </fieldset>
 <BR><BR>
 <fieldset style="padding: 3;">
 <legend><FONT COLOR="" Face='verdana' size='2'><B>Register</B></FONT></Legend>
        <P align=center><FONT SIZE="4" COLOR="#AA2504" face='monotype corsiva'>If you are not a registered user <Font COLOR="#AE0000"><B>Register Now</B></Font> its free</FONT></P>
    <table align=center>

        <tr align=center><TD><A HREF="Register0.jsp" target="HomeFrame"><img border="0" name="Register" src="Images/Register0.jpg" onmouseover="document['Register'].src='Images/Register1.jpg'" onmouseout="document['Register'].src='Images/Register0.jpg'" ></A></TD>
        </tr>

    </Table>

 </fieldset>
    </FORM>
    </BODY>



**2.validate.jsp**

<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>

<HEAD>


    <script LANGUAGE="Javascript" SRC="Images/validate.js"></script>
    <LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class="Sess">
<%

    Connection con=null;
    ResultSet rs=null,rs1=null;
    Statement stmt=null,stmt1=null;
    String UserID = request.getParameter("UserID"); 
    String Password = request.getParameter("Password");
    session.setAttribute("UserID",UserID);
    int flag=0;
    try{

            con = com.minglespot.ConnectionPool.getConnection();
            stmt =  con.createStatement();
            stmt1 =  con.createStatement();
            String Query = "select * from login where UserID = '"+UserID+"' and Password='"+Password+"'";
            System.out.println(Query);
            rs = stmt.executeQuery(Query);
            System.out.println(rs);
            if(rs!=null){
            String Query1="Select * from basicdetails where UserID='"+UserID+"' and Password='"+Password+"'";
            System.out.println(Query1);
            rs1=stmt1.executeQuery(Query1);
            System.out.println(rs1);
             if(rs1!=null)
            {
            while(rs1.next()){
            String PhotoPath=rs1.getString(4);
            System.out.println("-------------------"+PhotoPath);
            session.setAttribute("PhotoPath",PhotoPath);
            }
            }
            }
            if(rs.next())   
            {
            String Auth=rs.getString(3);
            session.setAttribute("Auth",new Integer(Auth));
                 flag=1;


             if(Auth.equals("0")){

                //Show Admin Menu
                %>
                  <jsp:forward page="AdminMenu.jsp"/>
                <%
             }else if(Auth.equals("1")){
                //Show user Menu
                %>
                  <jsp:forward page="UserHome.jsp"/>

                <%
             }
            }
            else
            {
             flag=0;

             %>
                  <jsp:forward page="Login.jsp"/>

             <%
            }
            stmt.close();
            con.close();
        }catch(Exception e){
            stmt.close();
            con.close();
            %><%=e%><%
        }

%>
</BODY>
View Answers









Related Tutorials/Questions & Answers:
social networking community system
social networking community system  In the above mentioned title login page not working properly. **1.login.jsp** <%@ page language="java" %> <%@ page session="true" %> <%@ page import="java.sql.*,java.io.
Top 10 Emerging Social Networking Sites
Top 10 Emerging Social Networking Sites It is no longer a literary expression... penetration and proliferation of social networking sites encompassing almost every walk..., a great array of emerging social networking sites are fast coming up to fill up
Advertisements
Facebook Social Media Marketing
in the field of social networking. Small and big businesses have made their way into social networking through Facebook, giving notion to the term Social Media...Facebook Social Media Marketing Facebook has been nothing short
networking
networking  how can i configure my xp computer as a ftp server and assign a name to it to access on the name rather than on its ip. just i need steps. AND WHY YOU INCLUDE NETWORKING ON THE ABOVE SELECT CATEGORY ? JUST
networking
networking  how can i configure my xp computer as a ftp server and assign a name to it to access on the name rather than on its ip. just i need steps. AND WHY YOU INCLUDE NETWORKING ON THE ABOVE SELECT CATEGORY ? JUST
networking
networking  how can i configure my xp computer as a ftp server and assign a name to it to access on the name rather than on its ip. just i need steps. AND WHY YOU INCLUDE NETWORKING ON THE ABOVE SELECT CATEGORY ? JUST
What is Niche Social Network?
the way we interact with people in the recent time, definitely social networking... social networking tends to go deeper. If you have not dwelt in a jungle cave far... in chatting, looking at the new posts, etc. You know social networking
Tools of Social Media Marketing
in advertising and marketing where companies do business by using social networking... be considered the harbinger of social networking as these were in existence even before the arrival of social networking sites. Forums offer space to share
Twitter Social Media Marketing
Twitter Social Media Marketing Twitter is a social networking website used for sending and receiving messages. These messages are called tweets. Well... kind of social networking is that it not only enables you to keep track of what
Social media marketing - how a profile can help you
Social media marketing - how a profile can help you Social networking... on a social networking site you can still present information about your business... Many of the major social networking sites allow for the creating of groups
System
System  What is System in System.out.println() method? Is it a Class or a Package
Social Media Marketing
popularity of social networking sites. In a nutshell, social media is any online portal... their presence felt across the social networking sites, as these are easy ways...Social Media Marketing Do you know that your postings on the Facebook
networking
E-Mail Marketing and Social Media
to use the Social networking websites, they can make their own friend lists and share messages, images etc.. There days Social Networking websites... such information easily from a Social Networking websites. So, business are considering
ModuleNotFoundError: No module named 'community'
ModuleNotFoundError: No module named 'community'  Hi, My Python... 'community' How to remove the ModuleNotFoundError: No module named 'community' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'community'
ModuleNotFoundError: No module named 'community'  Hi, My Python... 'community' How to remove the ModuleNotFoundError: No module named 'community' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'networking'
ModuleNotFoundError: No module named 'networking'  Hi, My Python... 'networking' How to remove the ModuleNotFoundError: No module named 'networking' error? Thanks   Hi, In your python environment you
Tutorial - Sun Java System Application Server Platform Edition
Sun Java System Application Server Platform Edition  ... System Application Server Platform version 9 for the deployment and testing of our... provided by it. The Sun Java System Application Server Platform Edition 9
Networking with OSI model
Networking with OSI model  What is networking and it's how to work with OSI model?   Please visit the following links: http://www.roseindia.net/java/network/index.shtml http://www.roseindia.net/technology/networking
Social Media Marketing for Small Business
Creating Social media presence on various Social Networking, Image...Social Media Marketing for Small Business We are providing Social Media... Social Media Marketing services for Small Business are well designed and gives
Social Media Marketing
websites. There are so many Social Networking and other websites where you can...Social Media Marketing In this section we will learn about social media marketing. These days Social Media Marketing is one of the most used method
Computer Networking
Computer Networking       Here we are going to unfold the concepts of networking in day to day scenarios. Let us consider that you started
Networking in Java
Networking in Java     ... provides the support for networking in java with a generic style. All the java...;  Now lets quickly move on to the networking part of java and take a look
What is Social Media?
and groups. Major social networking websites like Facebook, twitter and Okut... in social news. Facebook, Orkut and Twitter can be termed as social networking...What is Social Media? The working definition of social media could
Social Media Marketing for Business
had developed numerous social and professional networking sites including Facebook, MySpace, Hi5, Orkut, iBiBo, Linkedin etc. These social networking sites..., brands and corporate images among the social networking sites users. The users
How Big Data is used in social media?
Uses of Big Data in social media and its influence on it Various social networking websites are producing due data per second and it includes twitter posts... the performance of it product. People are very active on the social network
What is Social Media Marketing?
are easily seen over the course of the week with the help of these social networking... more money and would take a lot more time if it wasn't for the Social networking... Media Marketing, it feel right at home. Also, because most social networking
ModuleNotFoundError: No module named 'social'
ModuleNotFoundError: No module named 'social'  Hi, My Python... 'social' How to remove the ModuleNotFoundError: No module named 'social'... to install padas library. You can install social python with following command
ModuleNotFoundError: No module named 'social'
ModuleNotFoundError: No module named 'social'  Hi, My Python... 'social' How to remove the ModuleNotFoundError: No module named 'social'... to install padas library. You can install social python with following command
How does Social Media Marketing Work
actually Works"? As you all know Internet users visits the Social Networking... on social networking websites such as YouTube, Facebook, RSS Sites, Twitter... will have to spend time on Social Networking websites on the daily basis. You should
Influence of Social Media on Society
. With arrival of social networking sites these discussions have become important... and opinions on different things. In addition, these social networking... of these social networking sites is that it may expand network of the people
ModuleNotFoundError: No module named 'Community-Codeswarm'
ModuleNotFoundError: No module named 'Community-Codeswarm'  Hi, My... named 'Community-Codeswarm' How to remove the ModuleNotFoundError: No module named 'Community-Codeswarm' error? Thanks   Hi
ModuleNotFoundError: No module named 'community_detect'
ModuleNotFoundError: No module named 'community_detect'  Hi, My... named 'community_detect' How to remove the ModuleNotFoundError: No module named 'community_detect' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'community-learning'
ModuleNotFoundError: No module named 'community-learning'  Hi, My... named 'community-learning' How to remove the ModuleNotFoundError: No module named 'community-learning' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'community_mailbot'
ModuleNotFoundError: No module named 'community_mailbot'  Hi, My... named 'community_mailbot' How to remove the ModuleNotFoundError: No module named 'community_mailbot' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'djangoteams-community'
ModuleNotFoundError: No module named 'djangoteams-community'  Hi...: No module named 'djangoteams-community' How to remove the ModuleNotFoundError: No module named 'djangoteams-community' error? Thanks   Hi
ModuleNotFoundError: No module named 'djangoteams-community'
ModuleNotFoundError: No module named 'djangoteams-community'  Hi...: No module named 'djangoteams-community' How to remove the ModuleNotFoundError: No module named 'djangoteams-community' error? Thanks   Hi
ModuleNotFoundError: No module named 'modeldb-community'
ModuleNotFoundError: No module named 'modeldb-community'  Hi, My... named 'modeldb-community' How to remove the ModuleNotFoundError: No module named 'modeldb-community' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pynusmv-community'
ModuleNotFoundError: No module named 'pynusmv-community'  Hi, My... named 'pynusmv-community' How to remove the ModuleNotFoundError: No module named 'pynusmv-community' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'suds-community'
ModuleNotFoundError: No module named 'suds-community'  Hi, My... named 'suds-community' How to remove the ModuleNotFoundError: No module named 'suds-community' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'suds-community'
ModuleNotFoundError: No module named 'suds-community'  Hi, My... named 'suds-community' How to remove the ModuleNotFoundError: No module named 'suds-community' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Community-Codeswarm'
ModuleNotFoundError: No module named 'Community-Codeswarm'  Hi, My... named 'Community-Codeswarm' How to remove the ModuleNotFoundError: No module named 'Community-Codeswarm' error? Thanks   Hi
ModuleNotFoundError: No module named 'community_detect'
ModuleNotFoundError: No module named 'community_detect'  Hi, My... named 'community_detect' How to remove the ModuleNotFoundError: No module named 'community_detect' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'community-learning'
ModuleNotFoundError: No module named 'community-learning'  Hi, My... named 'community-learning' How to remove the ModuleNotFoundError: No module named 'community-learning' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'community_mailbot'
ModuleNotFoundError: No module named 'community_mailbot'  Hi, My... named 'community_mailbot' How to remove the ModuleNotFoundError: No module named 'community_mailbot' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'djangoteams-community'
ModuleNotFoundError: No module named 'djangoteams-community'  Hi...: No module named 'djangoteams-community' How to remove the ModuleNotFoundError: No module named 'djangoteams-community' error? Thanks   Hi
ModuleNotFoundError: No module named 'interpret-community'
ModuleNotFoundError: No module named 'interpret-community'  Hi, My... named 'interpret-community' How to remove the ModuleNotFoundError: No module named 'interpret-community' error? Thanks   Hi
ModuleNotFoundError: No module named 'cloudshell-networking'
ModuleNotFoundError: No module named 'cloudshell-networking'  Hi...: No module named 'cloudshell-networking' How to remove the ModuleNotFoundError: No module named 'cloudshell-networking' error? Thanks   Hi
ModuleNotFoundError: No module named 'cloudshell-networking'
ModuleNotFoundError: No module named 'cloudshell-networking'  Hi...: No module named 'cloudshell-networking' How to remove the ModuleNotFoundError: No module named 'cloudshell-networking' error? Thanks   Hi
ModuleNotFoundError: No module named 'mesh-networking'
ModuleNotFoundError: No module named 'mesh-networking'  Hi, My... named 'mesh-networking' How to remove the ModuleNotFoundError: No module named 'mesh-networking' error? Thanks   Hi, In your python

Ads