Register
Comments
Content
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <%@ page import="java.sql.*" %> <%@ page import="java.lang.*"%> <%@ page language="java" import="captchas.CaptchasDotNet" %> <%@ page import="captchas.CaptchasDotNet" %> <%@ page session="true" %> <html xmlns="http://www.w3.org/1999/xhtml"> <script language="JavaScript"> function validate() { var apos; var lpos; if(document.form1.Text1.value=="") { alert("name cannot be blank"); return false; } if(document.form1.Text2.value=="") { alert("father name cannot be blank"); return false; } if(document.form1.Text3.value=="") { alert("mother name cannot be blank"); return false; } if(document.form1.Text17.value=="") { alert("Dob cannot be blank"); return false; } if(document.form1.Text6.value=="") { alert("member of family cannot be blank"); return false; } if(document.form1.Text13.value=="") { alert("religion cannot be blank"); return false; } if(document.form1.Text7.value=="") { alert("nationality cannot be blank"); return false; } if(document.form1.Select1.value=="Select") { alert("occupation cannot be blank"); return false; } if(document.form1.Select2.value=="Select-income") { alert("income cannot be blank");
return false; } if(document.form1.TextArea1.value=="") { alert("address cannot be blank"); return false; } if(document.form1.Select3.value=="Select") { alert("state cannot be blank"); return false; } if(document.form1.Text14.value=="") { alert("city cannot be blank"); return false; } if(document.form1.Text15.value=="") { alert("pin code cannot be blank"); return false; } if(document.form1.Text11.value=="") { alert("phone no cannot be blank"); return false; } if( document.form1.Text16.value=="") { alert("Email Id cannot be blank"); return false; } else { apos=document.form1.textfield315.value.IndexOf("@"); lpos=document.form1.textfield315.value.lastIndexOf("."); if(apos<1 || (apos-lpos)<2) { alert(" Invalid Email Id"); return false; } } if(document.form1.Text12.value=="") { alert("user name cannot be blank"); return false; } if( document.form1.Password1.value=="") { alert("Password cannot be blank"); return false; } if( document.form1.Password2.value=="") { alert("Confirm Password cannot be blank"); return false; }
if( document.form1.Password1.value!= document.form1.Password2.value) { alert("The two passwords do not match"); return false; } if( document.form1.password.value=="") { alert("Captcha cannot be blank"); return false; } } </script> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Registration Form</title><style type="text/css"> <!-.style5 { font-size: xx-large; font-family: "Courier New", Courier, monospace; } .style6 {font-size: 16px} --> </style> </head> <body> <table width="732" height="743" border="1" align="center" bordercolor="#999999"> <tr> <td width="722" valign="top" style="height: 728px"><table width="721" border ="1"> <tr> <td width="271" height="106" valign="top"><img src="uid_logo_72dpi1_000. jpg" alt="Image Not Found" width="168" height="83" align="left" /><img src="imag es2.jpg" width="100" height="83" /> </td> <td width="434" valign="middle" bgcolor="#F0A532"><span class="style5"> UNIQUE IDENTIFICATION</span></td> </tr> </table> <% // Construct the captchas object (Default Values) CaptchasDotNet captchas = new captchas.CaptchasDotNet( request.getSession(true), // Ensure session "demo", // client "secret" // secret ); // Construct the captchas object (Extended example) // CaptchasDotNet captchas = new captchas.CaptchasDotNet( // request.getSession(true), // Ensure session // "demo", // client // "secret", // secret // "01", // alphabet // 16, // letters // 500, // width // 80 // height // ); %> <form name="form1" method="post" style="height: 705px" action="<%=response.encod eUrl("check.jsp")%>"> <table class="style1" style="width: 100%; height: 350px">
<tr> <td style="width: 166px" colspan="2">Name</td> <td colspan="2"><input name="Text1" style="width: 217px" type="t ext" /></td> </tr> <tr> <td style="width: 166px" colspan="2">Father name</td> <td colspan="2"><input name="Text2" style="width: 222px" type="t ext" /></td> </tr> <tr> <td style="width: 166px; height: 27px;" colspan="2">Mother name< /td> <td colspan="2" style="height: 27px"> <input name="Text3" style="width: 221px" type="text" /></td> </tr> <tr> <td style="width: 166px; height: 17px;" colspan="2">Gender</td> <td colspan="2" style="height: 17px"> <input checked="check ed" name="Radio1" type="radio" value="Male" /> Male <input name="Radio1" type="radio" value="Female" /> Female</ td> </tr> <tr> <td style="width: 166px; height: 17px;" colspan="2">Date of birt h</td> <td colspan="2" style="height: 17px"> <input name="Text17" style="width: 161px" type="text"> Ex. - 21/06/1975 </td> </tr> <tr> <td style="width: 166px; height: 17px;" colspan="2">Member of fa mily</td> <td colspan="2" style="height: 17px"> <input name="Text6" style="width: 50px" type="text" /></td> </tr> <tr> <td style="width: 166px" colspan="2">Religion</td> <td colspan="2"><input name="Text13" type="text" /></td> </tr> <tr> <td style="width: 166px" colspan="2">Nationality</td> <td colspan="2"><input name="Text7" type="text" /></td> </tr> <tr> <td style="width: 166px; height: 17px" colspan="2">Occuption</td > <td style="height: 17px" colspan="2"> <select name="Select1" style="width: 91px"> <option></option> <option selected="selected">Select</option> <option>Service</option> <option>House-wife</option> <option>Bussiness</option> <option>Student</option> <option>Other</option> </select> </td> </tr> <tr>
<td style="width: 166px" colspan="2">Family income</td> <td colspan="2"><select name="Select2" style="width: 114px"> <option></option> <option selected="selected">Select-income</option> <option>Below 100000</option> <option>100000-200000</option> <option>200000-300000</option> <option>300000-400000</option> <option>Above 400000</option> </select></td> </tr> <tr> <td style="width: 166px" colspan="2">Address</td> <td colspan="2"> <textarea name="TextArea1" rows="2" style="width: 275px"></texta rea></td> </tr> <tr> <td style="width: 49px">State </td> <td style="width: 166px"> <select name="S elect3" style="width: 84px"> <option></option> <option selected="selected">Select</option> <option value="MP">Madhya Pradesh</option> <option value="CH">Chattisgarh</option> <option value="MH">Maharastra</option> <option value="GJ">Gujrat</option> <option value="UP">U.P</option> <option value="AP">A.P</option> <option value="BR">Bihar</option> <option value="RJ">Rajsthan</option> </select></td> <td style="width: 29px" >City</td> <td ><input name="Text14" type="text" style="width: 148px" /></t d> </tr> <tr> <td style="width: 166px" colspan="2">Pin Code</td> <td colspan="2" > <input name="Text15" type="text" style="width: 148px" /></td> </tr> <tr> <td style="width: 166px" colspan="2">Phone no</td> <td colspan="2" ><input name="Text11" type="text" /></td> </tr> <tr> <td style="width: 166px" colspan="2">E-mail id</td> <td colspan="2" ><input name="Text16" type="text" /></td> </tr> <tr> <td style="width: 166px" colspan="2">User name</td> <td colspan="2" ><input name="Text12" type="text" /></td> </tr> <tr> <td style="width: 166px" colspan="2">password</td> <td colspan="2" ><input name="Password1" type="password" /></td> </tr> <tr> <td style="width: 166px" colspan="2">Confirm password </td> <td colspan="2" ><input name="Password2" type="password" /></td>
</tr> <tr> <td> <br /> <br /> <br /> </td> <td> <%-% it's possible to set a random in captchas.image("xyz"), % captchas.imageUrl("xyz") and captchas.audioUrl("xyz"). % This is only needed at the first request --%> <%= captchas.image() %><br> <a href="<%= captchas.audioUrl() %>">Phonetic spelling (mp3)</a> </td> </tr> <tr> <td> CAPTCHA &n bsp; &nbs p; </td> <td> <input name="password" size="16" /> <br /> </td> </tr> <tr> <td style="width: 166px; height: 24px;" colspan="2"> <input name="Submit1" type="submit" value="submit" onClick="vali date();" style="width: 70px" /> </td> <td colspan="2" style="height: 24px" > &n bsp;<input name="Reset1" type="reset" value="reset" style="width: 59px" /></td> </tr> </table> </form> <%-Connection con=null; Statement st=null; ResultSet rs=null; String str,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13; try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/uid","ro ot","root"); out.println("Connection Success"); s1=request.getParameter("Text1"); s2=request.getParameter("Text2"); s3=request.getParameter("Text3");
s4=request.getParameter("Radio1"); s5=request.getParameter("Text17"); s6=request.getParameter("Text7"); s7=request.getParameter("TextArea1"); s8=request.getParameter("Select3"); s9=request.getParameter("Text14"); s10=request.getParameter("Text11"); s11=request.getParameter("Text16"); s12=request.getParameter("Text12");
//Nationality
s13=request.getParameter("Password1");
out.println(s1); out.println(s2); out.println(s3); out.println(s4); out.println(s5); out.println(s6); out.println(s7); out.println(s8); out.println(s9); out.println(s10); out.println(s11); out.println(s12); out.println(s13);
//String k=request.getParameter("Text6"); //Integer myint1 = Integer.valueOf(k); // String l=request.getParameter("Text7"); //Integer myint2 = Integer.valueOf(l); //int m = myint2.intValue(); //int n = myint1.intValue(); { if(s1!=null && s2!=null && s3!=null && s4!=null && s5!=null && s6!=n ull && s7!=null && s8!=null && s9!=null && s10!=null && s11!=null && s12!=null & & s13!=null ) { str= "insert into registration (Name,Father_Name,Mother_Name,Gender, Dob,Nationality,Address,State,City,Phone_no,Email,Username,Password)values('" + s1 + "','" + s2 + "','" + s3 + "','" + s4 + "','" + s5 + "','" + s6 + "','" + s7 + "','" + s8 + "','" + s9 + "','" + s10 + "','" + s11 + "','" + s12 + "','" + s 13 + "')"; st=con.createStatement(); int j = st.executeUpdate(str); }
} } catch(Exception e) { out.println(e); } --%>
<table width="722" border="1"> <tr> <td width="712" align="center"><span class="style6"><a href="index.jsp ">Home</a> | <a href="about.html">About UID</a> | <a href="register.jsp">Registe r</a> | <a href="usage.html">UID Usage </a>| <a href="contact.html">Contact Us</ a></span> </td> </tr> </table> </td> </tr> </table> </body> </html>
Sponsor Documents