Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Jagadeesh
Script error
2 Answer(s)      5 years and 11 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

October 22, 2008 at 3:08 PM


Hi friend,

<html>

<head>

<title>Permission Restricted</title>
<script src="scripts/blockrclick.js"></script>
<link rel="stylesheet" href="css/form_tools.css" type="text/css">
<meta name="Microsoft Theme" content="sumipntg 011">
<script language="javascript">
<!--
function change()
{
var t1 = setTimeout("document.all.notice.color='#FF0000'",5000);
clearTimeout(t1);
setTimeout(change(),0);
}
//-->
</script>
</head>
<body onload="change()">
<script src="scripts/blockrclick.js"></script>

<table border="1" width="100%">
<tr>
<td width="100%" id="notice">
<p align="center"> <font face="Book Antiqua" color="#CC9900" size="4">
<b>Site can be viewed by only class members</b></font></td>
</tr>
</table>

<form action= "loginAction.jsp" method= "post">
<table border="0" width="100%" frame=border>
<tr>
<td width="30%" rowspan="2">
&nbsp;
<p>
&nbsp;</p>
</td>
<td width="18%">
<b><font face="Terminal" size="3" color="#808080">UserName</font></b></td>
<td width="17%" align="center">
<p align="left"><input type="text" name="username" size="20" tabindex="1" class="text">
</td>
<td width="35%" align="center">
</td>
</tr>
<tr>
<td width="18%">
<p align="left"><b><font face="Terminal" size="3" color="#808080">Password</font></b></td>
<td width="21%" align="center">
<p align="left"><input type="password" name="password" size="20" maxlength="10" tabindex="2" class="text"></p>
</td>
<td width="31%" align="center">
</td>
</tr>
<tr>
<td width="100%" colspan="4" >
<p align="center">
<input type="submit" value="Enter" name="B1" tabindex="3" class="submit"></td>
</tr>
</table>
</form>
</body>

</html>


October 22, 2008 at 3:13 PM


<%@ 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");
}

else{

response.sendRedirect("loginForm.jsp");

}


}

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

con.close();



} catch (Exception e) {

e.printStackTrace();

}

%>

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

If you have any problem then send me jsp code.

Thanks




Related Tutorials/Questions & Answers:
Script error - JSP-Servlet
Script error  Hello friends, In my log in page i decided to make a text as blinking one with it's color attribute with the interval... running this it shows an error as "STACK OVERFLOW". Correct the code . The code
script error - Java Beginners
script error  hi, Is it possiple to use PHP function under the script tag. plz help me. thank u in advance. regards, sakthi  Hi Friend, Yes It is possible to use PHP function under the script Tag. Thanks
Advertisements
Error Handling in Java Script
Error Handling in Java Script  ... will Learn how to handle error in java script. JavaScript is scripting language used for client side scripting. and error are handling in two ways.   *try
how to solve 'Stop Running This Script' Error ?
how to solve 'Stop Running This Script' Error ?  Hi.. When opened the page on IE browser(version : 8.0),it gives an java script error (i.e.Stop Running This Script). I have used jsp/servlet for this. Please help to resolved
Script#
Script#       Script# is a C# compiler and set of frameworks that makes it possible to write Javascript... checking, error reporting, intellisense, refactoring, class browsing, doc-comments etc
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first   import java.util.Scanner; class historyquiz{ public static void main(String args
Java Script
Java Script  why we are using java script
Java script
Java script  Source code for capturing the screen using Java Script
script for data
script for data  how to write a simple script to display a selected data from list in flex applicatin?.   Hi Friend, Please visit the following link: Flex Application Thanks
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
Java Script
Java Script  What is Java Script? How to learn Java Script?   Hi Java Script is client side programming language. It runs on browser.... You can learn Java Script from our JavaScript - JavaScript Tutorial pages
Window Script
Window Script  i want to write windows script can you help me in writing those i want to write script so that it follows below steps Step 1) downloading file from FTP 2) Unzip it 3) Edit it 4) zip it 5) upload again to FTP
java script
java script  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
Java script
Java script  a java script code for accept 10 numbers from the user and print in the descending order without using sort method
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script
Java Script  Hello Sir, Is it possible to select only current date from datetimepicker in struts2 through java script validation. Means when i select.... Try to send me java script validation code for this purpose that user won't
Java Script.
Java Script.  The below code is nit working in Google chrome can any one tell me the solution as soon as possible. <script type="text/javascript"> <!-- function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi i want to submit two form using javascript.The below code submitting two forms in server but its not working in browser like chrome and firefox am struggling for many days give me solution as soon as possible
error
error  while iam compiling iam getting expected error
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); out.println("<title></title>"); out.println("<script language
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); out.println("<title></title>"); out.println("<script language
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); out.println("<title></title>"); out.println("<script language
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;title></title>"); out.println("<script language='javascript
java script
java script  how will you identify whether the number entered by the user has two digits or three digits.Assuming that the user enters only a three digit or two digit number.   <HTML> <HEAD> <SCRIPT
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
java script
java script  write a java script code which provide a menu for user which will enable him/her to either add or subtract or multiply or divide two numbers and produce the corresponding result.   <html> <
error
error  i have 404 error in my program plz tell me yhe solution about
Advertisements
 

 

 

DMCA.com