i have checked all.. there is no other username

i have put all the codes involved in the coding..

please point out the mistake ..


<html>
<head>
<title>
Staffing
</title>
</head>
<h1>Add Staff</h1>
<body>

<%@ page language="java" import="java.sql.*" %>
<%!
String con_url =  "jdbc:mysql:///AAAServer?user=tjc&password=password";
Connection c;
Statement stmt1;
String username,password,AdminName;
%>

<%




       try
       {
           Class.forName("com.mysql.jdbc.Driver").newInstance();
       }

       catch (Exception E)
       {

           System.err.println("CONCEPT: Unable to Load Driver ");
           E.printStackTrace();
       }

%>



<table border="0" cellpadding="10">
<tr>


<%

           //   System.out.println("Connecting...");
           c = DriverManager.getConnection(con_url);
           //  System.out.println("Connection ok: " + c);



            stmt1 = c.createStatement();
%>
<th>UserName</th>
<td>
<form>
<input type="text" name="username1" size="8">

<%
username = request.getParameter("username1");
%>

</form>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<form>
<input type="text" name="AdminName" size="12">

</form>
</td>
</tr>
<tr>
<th>Password</th>
<td>
<form>
<input type="password" name="password" size="8">
<input type="submit" name="Add" value="AddStaff">
</form>
</td>
</tr>
</table>
</body>
</html>
<%

String submit1 = request.getParameter("Add");

        if(submit1 == null)
        {


        }


        else
        {


                password = request.getParameter("password");
                AdminName = request.getParameter("AdminName");
String query7 = "Insert into Admin(UserName,PassWord,Admin_type,Admin_Name) values('"+username+"','"+password+"', 'Staff','"+AdminName+"')";

                stmt1.executeUpdate(query7);
                stmt1.close();

        }
%>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to