Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 24th, 2005, 07:46 AM
abhit_kumar abhit_kumar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 22 abhit_kumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 3 sec
Reputation Power: 0
prob.. in login page

hi..all of u....

i have made a login page in html page...in which two text field there..named username and password...

i want to do the stuff that if the user enter correct username and password..then it displays a pop up window mentioning that u have successfully enetered and it then directly went into the mypage.jsp page...(targeted page)

and if users enter wrong entry then it displays error in another page..

plz... do the needful for me....i am not getting any thing....

my code is as follow:


try
{

String Username = request.getParameter("msno");
String Password = request.getParameter("pass");

sql = conn.prepareStatement("SELECT * FROM login_mast WHERE name = '" + Username + "' and password='"+Password+"' ");

results = sql.executeQuery();

while(results.next())
{

String Dbname = results.getString("name");
String Dbpassword = results.getString("password");


out.println("<TABLE >");
out.println("<TR>");
out.println("<TD><strong>Username</strong>:</TD>");
out.println("<TD><strong>Password</strong>:</TD></TR>");

out.println("<tr><td> <INPUT TYPE='TEXT' size='5' value='" + Dbname + "' readonly </td>");
out.println("<td> <INPUT TYPE='TEXT' size='5' value='" + Dbpassword + "' readonly </td></tr>");
}
}
catch (SQLException s)

Reply With Quote
  #2  
Old February 24th, 2005, 02:59 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Does your login code work and you want it to open in a popup instead of printing in the main window?
Or is your login code simply not working?

Reply With Quote
  #3  
Old February 25th, 2005, 01:52 AM
abhit_kumar abhit_kumar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 22 abhit_kumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 3 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
Does your login code work and you want it to open in a popup instead of printing in the main window?
Or is your login code simply not working?


yes my code doenot work...i want it to open in a popup and if login is correct then it directly went to correct page else error page.

Reply With Quote
  #4  
Old February 27th, 2005, 03:14 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 17 sec
Reputation Power: 15
Your code does not work.
Then the question is : what does not work ?

Are you sure your connection with the database is all right.
Your code does not mention how you implemented your connection.
Next question : if you get a connection with the database, does the
executeQuery return a resultset ?
I advice you to put some System.out.println statements in it to be
sure what is really happening.
If you want to avoid these ugly System.out.println, try Log4J to have
some logging.

And last but not least : if you have this working, learn about the
MVC or Model-View-Controller. It is good working practice to have
the JSP's taking care of presentation only.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > prob.. in login page


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap