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



Home Answers Viewqa HTML create a one web page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rajasekar
create a one web page
1 Answer(s)      3 years and 5 months ago
Posted in : HTML


create a one web page with stored values in a database..


Advertisement
View Answers

July 11, 2011 at 12:11 PM


1)form.html:

<html>
<form method="post" action="http://localhost:8080/examples/jsp/insert.jsp">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td>Confirm Password:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>Date Of Birth</td><td><input type="text" name="dob"></td></tr>
<tr><td>Age:</td><td><input type="text" name="age"></td></tr>
<tr><td>Gender</td><td><input type="text" name="gender"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td>State:</td><td><input type="text" name="state"></td></tr>
<tr><td>City</td><td><input type="text" name="city"></td></tr>
<tr><td>Telephone No:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*,java.util.*"%>
<table>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));

        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }


Related Tutorials/Questions & Answers:
create a one web page
create a one web page  create a one web page with stored values in a database
how to create web page on jsp?
how to create web page on jsp?  how to create web page on jsp
Advertisements
at one click to reveal the paricular part of a web page
at one click to reveal the paricular part of a web page  How to reveal the hidden code of particular part of a web page? Note:That hidden code coming from database(in while loop
May I know how to create a web page?
May I know how to create a web page?  can u suggest me how to start
Create Web Page with jsp
Web Page with jsp       In this example we will show you how to create first web page on tomcat.... For this we will create a simple dynamic JSP page with java.util.Date class (<
WEB PAGE
WEB PAGE  How To Create A Simple web Page Of a gmail using applet
web page
web page  1.Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked
Web Page
Web Page    Use any programming language or package to create a Project 2 .The Main menu should only be displayed, if the user is valid and uses... or package to create a basic User Interface that will be able to accept multi-level menu
Two Pagination in one page
Two Pagination in one page  hai friends any one help me. how do u make two pagination script in same page i'm used some ajax coding one pagination script is working but another pagination is not working please help me urgent
connect a web page to a database
connect a web page to a database  how to connect a web page to a database
Web page example
Web page example  Hi, How to make sample web page? Thanks   Hi, If you are aware of HTML then you can write simple web page for your... any HTML editor to create website pages. Thanks
how to create web aplli
how to create web aplli  how to Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc
how to create web aplli
how to create web aplli  how to Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc
new web page
new web page  I am creating a new web page for an user to sign up....how to give error messages if an user has not entered some fields(it can be one or many)... An example could be your webpage where you have indicated in red
php web page capture
php web page capture  How to capture the history of a web page using PHP
create a folder in jsp page
create a folder in jsp page  i want to create a folder in jsp page And it can be delete aslo
parser xml one page to another
parser xml one page to another  parser xml one page to another
setting web page size
setting web page size  How to set the webpage size in Java
web page design
web page design  Great Applianz Ltd. was established in 1985, in New.... The website should provide the following functionality: A Welcome page that gives the user a brief introduction about the company. This page should display the name
Web Page Transaction
Web Page Transaction  Hello sir, i want to add an Effective page transaction when i go to my home page to other page in js...plllzzz help me...rppy soon
map on web page
map on web page   i want to insert an area map in my web page how can i do it ? please answer me soon. Its urgent
create main page
create main page  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@page import="java.sql.*"%> <%@page import="java.util.*"%> <%@ page session="true
Web Page preprocessing
Web Page preprocessing  Java code to extract unique words from an XML file( has different web pages embedded inside <DOCNo>.. ) and display the unique set of words for each document. Say for example, the XML file has 49
web page access
web page access  I was store project in server and i will open that project file in client side add="http://server:8080/project..." this is very..." and project code = "Java Server Page" "HOW TO WRITE CODE CLIENT ACCESS SERVER
how to create a xml page
how to create a xml page  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...;head> <meta name="Description" content="Information architecture, Web Design, Web Standards." /> <meta name="Keywords" content="your, keywords
how to add web cam in web page
how to add web cam in web page  how do i embed my webcam in web page. code for embedding web cam in web page
web page reading in java
web page reading in java  i wanna read webpage in that i want to get the data from the particular tags like (,) and store into the data base...... can any body tell me the solution? plz urgnt. thanks and regards, jasti  
web service call in jsp page
web service call in jsp page  I am wandering on internet for hours looking for a simple and good example on how to create a simple JSP page to call a web service when you have a WSDL. I am using tomcat web server and eclipse
Bangla web page - JSP-Servlet
Bangla web page   what is the process to make a bangla web page in jee
how to create a login page and registration page?
how to create a login page and registration page?  hellow, pls tell me the code for how we can create a login page and registration page and how we can store the info in database.only in advance java as jsp
html program to create home page
html program to create home page  html program to create home page
Advertisements
 

 

 

DMCA.com