winnie99
12-17-2009, 05:14 AM
Hi everyone,
I have created a mysql database and a jsp website where users fill in their particulars.
If the users want to change their particulars, they need to login using their hp number.
So how do I ensure that the hp number that the users had entered matches the hp number stored in the mysql database?:confused:
Can anyone help me asap?:D
Thanks!!!:)
Below are my codes,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<html>
<head>
<title>Updating your Particulars</title>
</head>
<body>
<%
try {
String connectionURL = "jdbc:mysql://localhost:3306/testing123";
Connection connection = null;
Statement stmt = null;
ResultSet rst = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root", "password");
stmt = connection.createStatement();
rst = stmt.executeQuery("Select * current_info WHERE HP_No='' ");
} catch (Exception ex) {
System.out.println(ex);
}
%>
<h1>Update Particulars </h1>
<fieldset>
<legend> Update Page </legend>
<form method="post" action="Update_particulars.jsp" onsubmit="return checkform()">
<table border="0" cellpadding="10" cellspacing="0" width="100%" bgcolor="#FFFFFF">
To update your particulars, please key in your handphone number<p>
HP Number: <input type="text" name="hpno">
<input type="submit" value="Go" />
</form>
</fieldset>
</body>
</html>
I have created a mysql database and a jsp website where users fill in their particulars.
If the users want to change their particulars, they need to login using their hp number.
So how do I ensure that the hp number that the users had entered matches the hp number stored in the mysql database?:confused:
Can anyone help me asap?:D
Thanks!!!:)
Below are my codes,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<html>
<head>
<title>Updating your Particulars</title>
</head>
<body>
<%
try {
String connectionURL = "jdbc:mysql://localhost:3306/testing123";
Connection connection = null;
Statement stmt = null;
ResultSet rst = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root", "password");
stmt = connection.createStatement();
rst = stmt.executeQuery("Select * current_info WHERE HP_No='' ");
} catch (Exception ex) {
System.out.println(ex);
}
%>
<h1>Update Particulars </h1>
<fieldset>
<legend> Update Page </legend>
<form method="post" action="Update_particulars.jsp" onsubmit="return checkform()">
<table border="0" cellpadding="10" cellspacing="0" width="100%" bgcolor="#FFFFFF">
To update your particulars, please key in your handphone number<p>
HP Number: <input type="text" name="hpno">
<input type="submit" value="Go" />
</form>
</fieldset>
</body>
</html>