CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 login page

Print topic Send  topic

Author Message
rekha dahiya
Posted: 10/25/2005, 12:19 AM

hi
i am design a login page in html. username= nic,and password= nic1 so i design four page .first login page and second check page in jsp and third main page and fourth error page this page used in this time my user &password are wrong.
plz any give me the code is check page .plz help me i am thankful you and reply my email id.
ok
vidyasagar

Posts: 7
Posted: 11/29/2005, 1:59 AM

Hi, rekha

please send what exactly your problum.

i hope, i will solve your problum

all the best
_________________
Thank you.
vidya sagar
View profile  Send private message
sheetal
Posted: 11/30/2005, 4:50 AM

quote]This code simply works.Mail me at sheetal_sh1@yahoo.co.in if my code solves ur problem
<%@ include file="allpkge.jsp" %> <!-- This has all packages imported -->
<html><head><title>Verify login</title></head>
<body>
<%
Connection dbcon;
ResultSet rs;
Statement stmt;
try {
Class.forName("com.mysql.jdbc.Driver");
dbcon = DriverManager.getConnection(localhost,username,password);
String var1 = request.getParameter("username");
String var2 = request.getParameter("password");

String s1 = "select * from table_name where empno = '"+var1+"' and password = '"+var2+"'";
stmt=dbcon.createStatement();
rs=stmt.executeQuery(s1);
String var3 = new String();
String var4 = new String();

while(rs.next())
{
var3 = rs.getString(1);
var4 = rs.getString(2);
}
if(!var1.equals(var3) && !var2.equals(var4))
{
response.sendRedirect("login.html");
}
else if((var1.equals(var3)) && (var2.equals(var4)))
{
response.sendRedirect("viewu.jsp");
}
}
catch (ClassNotFoundException err)
{
out.println("Class loading error");
}
%>
</body></html>

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.