pls send me the code for login and register

pls send me the code for login and register

View Answers

September 19, 2008 at 7:01 PM

Hi friend,


This login action code.

<%@ page language="java" import="java.sql.*" import="java.util.*" %>


<%



String userid = request.getParameter("userid");

String password = request.getParameter("password");



Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String pass="amar123";

try {

Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,pass);

Statement st = con.createStatement();

String strQuery = "select * from login where userid='"+userid+"' and password='"+password+"'";

out.println(strQuery);

ResultSet rs = st.executeQuery(strQuery);



while(rs.next()){

if((rs.getString(1).equals("admin")) && (rs.getString(2).equals("admin")))

{

session.setAttribute("userid",userid);

response.sendRedirect("userForm.jsp");
}


if((rs.getString(1).equals("user")) && (rs.getString(2).equals("user")))

{

session.setAttribute("userid",userid);

response.sendRedirect("registrationForm.jsp");
}

else{

response.sendRedirect("loginForm.jsp");

}


}

System.out.println("Connected to the database");

con.close();



} catch (Exception e) {

e.printStackTrace();

}

%>

-------------------------------------------------

I am sending you a link. This link will help you. Please visit for more information.

http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml


Thanks.









Related Tutorials/Questions & Answers:
pls send me the code for login and register - Java Beginners
pls send me the code for login and register  pls immediately send me the jsp code for login and registration with validation with java bean in mysql database...  Hi friend, This login action code
pls send code
pls send code   pls send code for set database value into text box based on selected value in struts and jsp   use any database and get its code for getting values from google
Advertisements
Pls send code
Pls send code   I am Mohini Charankar suppose Name="Mohini" Edit Button Click on that I change my Name with "Mohini/" Save it and page refresh After... an error pls send code
login and register - Java Beginners
login and register  pls send me the code for login and register immediately  Hi friend, Please specify the technology you want code for login and register. For example : JSP,Servlet,Struts,JSF etc
send me javascript code - Java Beginners
send me javascript code  please send me code javascript validation code for this html page.pleaseeeeeeeee. a.first:link...          Hi friend, complete code
how to send email please give me details with code in jsp,servlet
how to send email please give me details with code in jsp,servlet  how to send email please give me details with code in jsp,servlet
I didn't gat an output for this code, plz send me a correct code
I didn't gat an output for this code, plz send me a correct code  Hi, Here is my code: import java.awt.event.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.*; import java.sql.*; public
pls send maven interview questions
pls send maven interview questions  pls send maven interview questions to [email protected]
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
Pls anyboby tell me...
Pls anyboby tell me...  which book easy to learn spring
please send me javascript validation code - Java Beginners
please send me javascript validation code  hallo sir , please send me java script code for this html page.since i want to do validation.i am a new user in java ....please send me its urgent
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
pls help me with this question
pls help me with this question  how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me...........
Pls help me...........  how to use the text file as input to insert the values injdbc?   Please visit the following link: Insert text file data into database
pls send reply - Java Beginners
pls send reply  i get the error Error Occurred:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) how to remove
Pls provide me jsp code to get values in drop down list from another table's field....
Pls provide me jsp code to get values in drop down list from another table's field....  my project has customer registration and company registration........ pls provide me code.. thanx
pls send reply - Java Beginners
pls send reply  i get the error Error Occurred:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) how to remove   Hi Friend, Check your connection string, username
sir, how to convert excel file to csv file using java? please send me sample code.
sir, how to convert excel file to csv file using java? please send me sample code.  please send me sample code for converting excel file into csv file uisng java
i want to create website,with manu with three level submenu on top side of page please send me code java
i want to create website,with manu with three level submenu on top side of page please send me code java   iam createing wibsite thats using eclipse andtomcat server,please help me to write menu with three level submenu
pls. help me - Java Beginners
pls. help me  please help me i do need now if its okay... Consider the method headings: void funcOne(int[] alpha, int size) int funcSum(int x,int y) void funcTwo(int[] alpha, int[] beta) and the declarations: int
send me example of jmsmq - JMS
send me example of jmsmq  please send me example about jmsmq (java microsoft message queuing ) library
Code to register a new patient in a clinic
Code to register a new patient in a clinic  Hi, How do i write a code that allows a user to enter someone's name and then search for that name from a text file. If the name is not available it opens up a form to register
code to send sms alerts using jsp online
code to send sms alerts using jsp online  I am new to mobile aplication development. pls send me the code for sms alerts after clicking the button
sourse code pls
sourse code pls  customer registration code in java?   Hello Friend, Please visit the following links: http://www.roseindia.net/jsp/javascriptpagerefresh.shtml http://www.roseindia.net/jsp/user-registration-form
java code for registration and login pages, mysql as a bankend.
java code for registration and login pages, mysql as a bankend.  please send me the java code for registration and login pages and to store the data in mysql
please send me the answer - JDBC
please send me the answer -difference between DriverManager and DataDourse   what is Datasourse? What r the advantages? what is the difference between DriverManager and DataDourse
swing login code
swing login code  code for the login form
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
pls review my code - Struts
pls review my code  When i click on the submit page i am getting a blank page Pls help me. thanks in advance. public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request
Pls review my code - Struts
Pls review my code  Hello friends, this is my code in struts action class this page contains checkboxes and radiobuttons also. when i enter the submit it shows me blank page. can anybody solve my problem its urgent. help me
pls help me sir its urgent
pls help me sir its urgent  thanks for reply, but i am getting this error pls help me its urgent type Exception report message description The server encountered an internal error () that prevented it from
pls review my code - Struts
pls review my code  Hello friends, This is the code in struts. when i click on the submit button. It is showing the blank page. Pls respond soon its urgent. Thanks in advance. public class LOGINAction extends Action
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
plz send code for this
plz send code for this  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
pls give me answer ae soon as possible - Ajax
pls give me answer ae soon as possible  i m writing code of ajax technology ...but it is not working pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
java code to send an email
java code to send an email  i developed one java code that has to send a mail but i am getting an runtime exception calledjavax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested
please send me the banking data base in swings
please send me the banking data base in swings  sir, please send me how to create the banking data base program in swings
php login and logout code
php login and logout code  Hi, Can anyone share there code for creating a user login and logout page in PHP?or any useful tutorial that can help to create a login and logout application in PHP.. Thanks in Advance
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
code for login fom - Struts
code for login fom  we have a login form with fields USERNAME: PASSWORD: In this admin can login and also narmal uses can log
HTML login page code
the complete HTML JavaScript code for User Login Page. Thanks in Advance!   ...HTML login page code  Hi all, I am writing my first HTML JavaScrip validation page called "UserLogin.html". So, please guide me how to validate user
pls tell me the difference between the run() and start() in threads in java....
pls tell me the difference between the run() and start() in threads in java....  difference between the run() and start() in threads in java
need code for login in asp.net with c#
need code for login in asp.net with c#  hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
Show me the code for that
Show me the code for that  JVM on my machine? And how do I know whether its working
please send code - Java Beginners
please send code  hai friends plese provide code for fallowing... number it should be taken as single number) URGENTLY send the code for this  Hi friend, Code to solve the problem : class StringExampleJava

Ads